Skip to content

今天更新了Picker组件还有两个问题: #862

@laogui

Description

@laogui
          今天更新了Picker组件还有两个问题:
  1. WheelPicker滑动一个条目有时候不生效,多滑几个值就没问题。还是const _index = Math.ceil(offsetY / itemHeight) + 1 计算有误,滑动换了一个值,但_index没变。

  2. Picker组件在ios下初始值value不生效,android没问题,每次打开都是选中第一个,用setTimeout可以解决

  useEffect(() => {
    setTimeout(() => {
      flatListRef.current?.scrollToIndex({
        index: selectedIndex,
        animated: false,
      })
    }, 100)
  }, [selectedIndex])

Originally posted by @laogui in #721 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions