Skip to content

[Bug] Slider tapToSeek通过点击无法触发onChange #1417

@MuNitCat

Description

@MuNitCat

💬 前提强调

  • I have searched the issues of this repository and believe that this is not a duplicate.

🙋 描述详情/重现步骤

     <Slider
              // marks={marks}
              style={{flex: 1, marginLeft: 16}}
              defaultValue={100}
              max={200}
              min={20}
              disabledStep={false}
              tapToSeek={true}
              icon={
                <TouchableOpacity
                  hitSlop={TwCss.hitSlop}
                  activeOpacity={0.8}
                  style={styles.sliderIcon}
                />
              }
              onChange={val => {
                console.log('[onChange]', val);
              }}
              onAfterChange={val => {
                console.log('[onAfterChange]', val);
              }}
              onSlidingStart={(val, index) =>
                console.log('onSlidingStart', {val, index})
              }
              onSlidingComplete={(val, index) =>
                console.log('onSlidingComplete', {val, index})
              }
            />

直接点击无法触发 onChange ,没有途径获取新值

🔴 版本

5.3.2

💻 运行环境

iOS

⚫️ npx react-native info输出信息

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 57.23 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.3
    path: ~/.nvm/versions/node/v18.20.3/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v18.20.3/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v18.20.3/bin/npm
  Watchman:
    version: 2025.03.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11709847
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.23
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.12
    wanted: 0.72.12
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

补充说明

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions