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组件异步类型searchable属性失效 #1577

Closed
Nice-Ming opened this issue Feb 2, 2021 · 1 comment · Fixed by #1582 or #1631
Closed

Select组件异步类型searchable属性失效 #1577

Nice-Ming opened this issue Feb 2, 2021 · 1 comment · Fixed by #1582 or #1631
Labels
comp:select enhancement New feature or request

Comments

@Nice-Ming
Copy link
Collaborator

Bug 描述
Select组件异步类型searchable属性失效

参考
重现步骤:

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
        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
          })
        }}
      />
    )
  }
}

预期行为
searchable属性为false时,隐藏搜索功能

截屏
如果方便的话可以提供一个截屏描述你的问题。
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
@GleanCoder1116 GleanCoder1116 added enhancement New feature or request and removed bug Something isn't working labels Feb 3, 2021
@GleanCoder1116
Copy link
Collaborator

做了兼容处理,在异步筛选时候,默认显示,传入 searchable 属性后可控制筛选框的显示隐藏

@GleanCoder1116 GleanCoder1116 linked a pull request Feb 3, 2021 that will close this issue
GleanCoder1116 pushed a commit that referenced this issue Feb 24, 2021
GleanCoder1116 pushed a commit that referenced this issue Feb 24, 2021
This was referenced Feb 24, 2021
@GleanCoder1116 GleanCoder1116 linked a pull request Mar 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:select enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants