emerald-web-framework icon indicating copy to clipboard operation
emerald-web-framework copied to clipboard

[Sling-button] button's label is clickable even though button is disabled

Open caiomdias opened this issue 5 years ago • 3 comments

I'm submitting a:

[x] bug report [ ] feature request [ ] support request

Current behavior:

If you click a disabled it works as expected (does not call the onclick event). Although, if you click on the label, it calls the onclick event.

Expected behavior:

A disabled sling-button should never issue an onclick event, no matter where it's clicked.

caiomdias avatar Oct 03 '18 19:10 caiomdias

I'd like to handle this and open a Pull Request, @caiomdias.

StanleySathler avatar Oct 13 '18 19:10 StanleySathler

I think we could handle it in two different ways:

  1. Add a disabled attr to all slot elements;
  2. Handle button's click internally and stop event propagation in case it is disabled.

Any suggestions @caiomdias? I'm kinda new with these web components, so there might be a better approach.

StanleySathler avatar Oct 17 '18 02:10 StanleySathler

Hey @StanleySathler! Sorry for the delay.

I think the second suggestion is the best one to follow. Fell free to implement the best way you can.

Tell us if you need any help.

breakzplatform avatar Oct 23 '18 19:10 breakzplatform