Slider "active area" is offset from where the actual element is
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- react-native, typescript
- 領域
- frontend
研究方向
先使用瀏覽器的 iPhone 和 iPad Pro 回應式預設重現 issue 中的 Slider 範例,然後將元素的位置與滑鼠拖曳的作用區域進行比較。報告中沒有指定原始檔案或測試;在較大的預設下,點擊和拖曳始終一致地使用可見的 slider 邊界即表示完成。
由索引模型根據 Issue 內容生成。
描述
Environment
System:
OS: macOS 12.6
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 680.34 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v14.17.0/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8512546
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: javac 19 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
(Possibly) relevant deps from package.json:
"@react-native-community/slider": "4.2.4",
"@react-navigation/material-top-tabs": "6.2.1",
"@react-navigation/native": "6.0.10",
"@react-navigation/native-stack": "6.6.2",
"expo": "~44.0.2",
"expo-font": "~10.0.4",
"expo-splash-screen": "~0.14.1",
"expo-status-bar": "~1.2.0",
"jsc-android": "^250230.2.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-calendars": "1.1289.0",
"react-native-collapsible": "1.6.0",
"react-native-pager-view": "5.4.9",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-tab-view": "3.1.1",
"react-native-web": "0.17.1"
Description
I have a Slider component that works perfectly fine on browser simulated mobile phone environment (Chrome -> responsive "iPhone 6/7/8 Plus" preset). But when I use the slider on a bigger screen (Chrome -> responsive "iPad Pro" preset), the active range (where the slider starts moving with mouse drag) is far to the left from where the actual slider element is.
Let's say, the slider element is between width 750px and 900px:
- When I simply click on the slider, it goes automatically to maximumValue
- If I click & hold the slider, and then pull to the left side of the screen, nothing happens to the slider. It does not move.
- But when I reach the left edge of the screen (about 100px), then the slider starts to move with the mouse drag.
Here's a video. The first part is the "click makes it max value", and then comes the slider offset:
https://user-images.githubusercontent.com/5442750/209342148-200b56a4-8bda-4a1a-a495-d398c9423b03.mov
Reproducible Demo
const styles = StyleSheet.create({
sliderBox: {
flexDirection: 'row',
},
});
interface Params {
min: number;
max: number;
initialValue: number;
bidToEdit: Bid;
setter: Function; // This just passes the value to the parent, does not affect incoming params
}
export const CustomSlider = ({ min, max, initialValue, bidToEdit, setter }: Params) => {
const [value, setValue] = useState<number>(initialValue);
const sliderUpdated = (newValue: number) => {
console.warn('Slider update to', newValue);
setValue(newValue);
setter(newValue);
};
return (
<View style={styles.sliderBox}>
<Slider
value={value}
step={1}
onValueChange={sliderUpdated}
minimumValue={min}
maximumValue={max}
minimumTrackTintColor={Colors.blue900Default}
maximumTrackTintColor={Colors.blue50}
thumbTintColor={Colors.blue900Default}
/>
<SliderPoints value={value} updatePoints={sliderUpdated} min={min} max={max} />
</View>
);
};
I've also tried setting a maxWidth for the containing <View> but it doesn't change the behaviour.
I have also tried using onSlidingComplete and onSlidingStart, but the behaviour is still the same.
- 主要語言
- TypeScript
- 星號
- 1.4k
- 分支
- 296
- 平均合併
- 4 天 12 分鐘
- 30 天內合併 PR
- 7
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstack/react-native-slider 的其他 Issue
-
Web: value={0} with a negative minimumValue renders the thumb at the minimum可能已有人在做 @huytdps13400 於 19 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
callstack/react-native-slider#828 ·
維護者通常 1 天內回覆
-
Missing peerDependencies for react and react-native causes duplicate React instances in pnpm monorepos可能已有人在做 @patrickwehbe 於 123 天前認領。 未關閉bug report
難度 1/5 1 小時以內 新手友好度 68/100
callstack/react-native-slider#769 ·
維護者通常 1 天內回覆
-
Web: step snapping ignores minimumValue可能已有人在做 @RaphaelFakhri 於 1 天前認領。 未關閉platform: Web v6
難度 2/5 1-3 小時 新手友好度 35/100
callstack/react-native-slider#840 ·
維護者通常 1 天內回覆
-
bug report platform: iOS v6
難度 4/5 3-5 天 新手友好度 42/100
callstack/react-native-slider#782 · 6 則留言 ·
維護者通常 1 天內回覆
-
bug report
難度 3/5 1-2 天 新手友好度 35/100
callstack/react-native-slider#767 ·
維護者通常 1 天內回覆
查看 callstack/react-native-slider 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
phivk/rubiks-lab#33 ·
維護者通常 1 天內回覆
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited可能已有人在做 @ManyaJain111 今天認領。 未關閉bug enhancement possible-duplicate
難度 2/5 1-3 小時 新手友好度 77/100
AOSSIE-Org/PictoPy#1637 · 4 則留言 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
chaitin/MonkeyCode#1437 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
area:cards enhancement migration ready-for-agent
難度 2/5 1-3 小時 新手友好度 70/100
fil-donadoni/tolaria#6309 ·
維護者通常 1 天內回覆