Slider "active area" is offset from where the actual element is
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ Slider trong issue với các preset responsive iPhone và iPad Pro của trình duyệt, sau đó so sánh vị trí của phần tử với vùng hoạt động kéo bằng chuột. Báo cáo không xác định tệp nguồn hoặc test nào; được xem là hoàn tất khi các thao tác nhấp và kéo sử dụng nhất quán các giới hạn hiển thị của slider trên preset lớn hơn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.4k
- Fork
- 295
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstack/react-native-slider
-
Web: value={0} with a negative minimumValue renders the thumb at the minimumCó thể đã có người làm @huytdps13400 đã nhận 17 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
callstack/react-native-slider#828 ·
-
Missing peerDependencies for react and react-native causes duplicate React instances in pnpm monoreposCó thể đã có người làm @patrickwehbe đã nhận 122 ngày trước. Đang mởbug report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
callstack/react-native-slider#769 ·
-
bug report platform: iOS v6
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
callstack/react-native-slider#782 · 6 bình luận ·
-
iOS: negative min value and 0 as maximum value turns maximum to 1Có thể đã có người làm @huytdps13400 đã nhận 15 ngày trước. Đang mởbug report
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
callstack/react-native-slider#780 · 1 bình luận ·
-
bug report
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
callstack/react-native-slider#767 ·
Tất cả issue của callstack/react-native-slider
Issue tương tự
-
DQ assisgnment closing at CRĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
equinor/prisma-decision-web#919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[DC] OneLogin sync imports a partial user list when an API request failsCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
bitwarden/directory-connector#1276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
home-assistant/installer#324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mondriaan
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
knaw-huc/textannoviz#733 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày