dash-html-components icon indicating copy to clipboard operation
dash-html-components copied to clipboard

Boolean attributes in button: disabled

Open Akronix opened this issue 7 years ago • 3 comments
trafficstars

Hello.

I'm trying to use the disabled attribute in the button element.

Firstly, I've noticed that its type is String instead of Boolean. Secondly, I've trying to set the prop disabled='disabled', but it does not work; and it is still enabled.

Other props of button with expected similar behaviour (boolean props) are: autoFocus, contentEditable, draggable, hidden, spellCheck, etc.

Akronix avatar Dec 21 '17 17:12 Akronix

I finally got it done using the disabled attribute with a string as it is currently in the upstream repo.

Nevertheless, I was taking a look on how to change the PropTypes of html attributes, but I didn't find the way to do it. I guess that changing it directly in Button.react.js isn't the right way.

Akronix avatar Jan 29 '18 14:01 Akronix

Have you tried setting it to simply True? I am doing that with html.Button for a long time and never had an issue with html.Button("I am a disabled button", disabled=True).

radekwlsk avatar Jul 18 '18 12:07 radekwlsk

Hmm I just checked and it does work! But the prop for disabled in the component is still Boolean :thinking:

Akronix avatar Jul 23 '18 10:07 Akronix