Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select组件异步类型选项内容消失 #1578

Closed
Nice-Ming opened this issue Feb 2, 2021 · 0 comments · Fixed by #1582
Closed

Select组件异步类型选项内容消失 #1578

Nice-Ming opened this issue Feb 2, 2021 · 0 comments · Fixed by #1582
Labels
bug Something isn't working comp:select

Comments

@Nice-Ming
Copy link
Collaborator

Bug 描述
Select组件异步类型选项内容消失

参考
重现步骤:

  1. 使用 Select 组件
  2. 第一次展开下拉框,有选项内容
  3. 第二次展开下拉框,没有选项内容
import React from 'react'
import Select from '@hi-ui/hiui/es/select'

class Demo extends React.Component {
  constructor () {
    super()
    this.state = {
      value:['1']
    }
  }
  render () {
    const {value} = this.state
    return (
      <Select
        autoload
        type="multiple"
        searchable={false}
        dataSource={{
          method: 'GET',
          key: 'id',
          url: 'https://mife-gallery.test.mi.com/hiui/stores',
          transformResponse: (res) => {
            if(res && res.code === 200){
              return res.data
            }
            return []
          }
        }}
        placeholder='请选择'
        style={{ width: 200 }}
        onChange={(item) => {
          console.log('异步单选结果', item)
          this.setState({
            value:item
          })
        }}
      />
    )
  }
}

预期行为

截屏
第一次打开下拉框
image

第二次打开下拉框
image

可重现环境:

  • 系统: [macOS]
  • 浏览器: [chrome]
  • HIUI 的版本: [3.4.0]

附加内容
关于此问题的其它信息。

@Nice-Ming Nice-Ming added the bug Something isn't working label Feb 2, 2021
GleanCoder1116 pushed a commit that referenced this issue Feb 3, 2021
GleanCoder1116 pushed a commit that referenced this issue Feb 3, 2021
Nice-Ming added a commit that referenced this issue Feb 3, 2021
@GleanCoder1116 GleanCoder1116 linked a pull request Feb 3, 2021 that will close this issue
@GleanCoder1116 GleanCoder1116 mentioned this issue Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comp:select
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants