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
jasonxia23 opened this Issue Apr 13, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@jasonxia23
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

This comment has been minimized.

ant-design-bot commented Apr 13, 2018

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)

dengfuping added a commit that referenced this issue Apr 14, 2018

afc163 added a commit that referenced this issue Apr 15, 2018

Input.Search should disable enter button when disabled prop is true (#…
…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

@afc163 afc163 closed this Apr 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment