nutui-react icon indicating copy to clipboard operation
nutui-react copied to clipboard

Popover在ScrollView中定位错误

Open Yzzzed opened this issue 4 months ago • 0 comments

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

3.0.18

平台

weapp

重现链接

重现步骤

复现组件代码:

// src/components/popover-test/index.tsx
import type { PopoverProps } from '@nutui/nutui-react-taro'
import { Popover } from '@nutui/nutui-react-taro'
import type { FC, PropsWithChildren } from 'react'
import { useState } from 'react'

const PopoverTest: FC<PropsWithChildren<{
  list: PopoverProps['list']
}>> = ({ list, children }) => {
  const [open, setOpen] = useState(false)
  return (
    <Popover location="bottom" list={list} visible={open} onClick={() => open ? setOpen(false) : setOpen(true)}>
      {children}
    </Popover>
  )
}

export default PopoverTest
// src/pages/index/index.tsx
import PopoverTest from '@/components/popover-test'
import { ScrollView, Text, View } from '@tarojs/components'

export default function Index() {
  return (
    <View className="py-100px bg-#f2f2f2 h-100vh">
      <PopoverTest list={[{ key: 'key1', name: 'not in scrollView' }]}>
        <Text>not in scrollView</Text>
      </PopoverTest>
      <ScrollView enhanced showScrollbar={false}>
        {Array.from({ length: 100 }).map((_, index) => {
          return (
            <View key={index} className="p-40px">
              <PopoverTest list={[{ key: `${index}`, name: `测试${index}` }]}>
                <Text>
                  测试
                  {index}
                </Text>
              </PopoverTest>
            </View>
          )
        })}
      </ScrollView>
    </View>
  )
}

期望的结果是什么?

Popover在ScrollView中定位正确。

实际的结果是什么?

Popover在ScrollView中定位错误。

Image Image Image

环境信息

👽 Taro v4.0.12

Taro CLI 4.0.12 environment info: System: OS: macOS 15.6 Shell: 5.9 - /bin/zsh Binaries: Node: 22.16.0 - ~/.nvm/versions/node/v22.16.0/bin/node npm: 10.9.2 - ~/.nvm/versions/node/v22.16.0/bin/npm npmPackages: @tarojs/cli: 4.0.12 => 4.0.12 @tarojs/components: 4.0.12 => 4.0.12 @tarojs/helper: 4.0.12 => 4.0.12 @tarojs/plugin-framework-react: 4.0.12 => 4.0.12 @tarojs/plugin-html: 4.0.12 => 4.0.12 @tarojs/plugin-mini-ci: ^4.0.12 => 4.0.12 @tarojs/plugin-platform-weapp: 4.0.12 => 4.0.12 @tarojs/react: 4.0.12 => 4.0.12 @tarojs/runtime: 4.0.12 => 4.0.12 @tarojs/shared: 4.0.12 => 4.0.12 @tarojs/taro: 4.0.12 => 4.0.12 @tarojs/taro-loader: ^4.0.12 => 4.0.12 @tarojs/webpack5-runner: ^4.0.12 => 4.0.12 babel-preset-taro: 4.0.12 => 4.0.12 eslint-config-taro: ^4.0.12 => 4.0.12 react: ^18.2.0 => 18.3.1

其他补充信息

No response

Yzzzed avatar Sep 01 '25 03:09 Yzzzed