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

disable Search 组件的时候,应该同时禁用 Search 按钮 #10040

Closed
1 task done
jasonxia23 opened this issue Apr 13, 2018 · 1 comment
Closed
1 task done

disable Search 组件的时候,应该同时禁用 Search 按钮 #10040

jasonxia23 opened this issue Apr 13, 2018 · 1 comment

Comments

@jasonxia23
Copy link
Contributor

jasonxia23 commented Apr 13, 2018

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

Version

3.4.1

Environment

浏览器

Reproduction link

https://ant.design/components/input-cn/

Steps to reproduce

<Input.Search /> 设置 disabled 属性只会禁用输入框,而不会禁用按钮,这会造成潜在的问题

What is expected?

disable Search 组件的时候,应该同时禁用 Search 按钮

What is actually happening?

按钮不会被禁用,造成点击按钮的时候,相应的回调会被触发(虽然理论上可以拦截这个回调逻辑的执行,但是这样的设计并不优雅)

@ant-design-bot
Copy link
Contributor

Translation of this issue:


When ## disable Search component, the Search button should be disabled at the same time

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

Version

3.4.1

Environment

Explorer

Reproduction link

[https://ant.design/components/input-en/] (https://ant.design/components/input-cn/)

Steps to reproduce

Setting the disabled attribute to <Input.Search /> only disables the input box without disabling the button, which creates potential problems

What is expected?

When you disable the Search component, you should also disable the Search button

What is actually happening?

The button will not be disabled, causing the corresponding callback to be triggered when the button is clicked (although theoretically it is possible to intercept the execution of this callback logic, but this design is not elegant)

@afc163 afc163 added Accept You are right, we should do that help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. labels Apr 13, 2018
afc163 pushed a commit that referenced this issue Apr 15, 2018
…10051)

* Input Search should disable enter button when disabled prop is true, close #10040

* test: Add test case for commit bd21722
@dengfuping dengfuping self-assigned this Apr 16, 2018
@dengfuping dengfuping added Component: Input and removed Accept You are right, we should do that help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. labels Apr 16, 2018
@afc163 afc163 closed this as completed Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants