AlaskaAirlines / auro-menu

Custom element that provides a list of options for the user to choose from
https://auro.alaskaair.com/components/auro/menu
Apache License 2.0
2 stars 3 forks source link

Uncheck disabled option #174

Closed jesussilverioea closed 11 months ago

jesussilverioea commented 1 year ago

Describe the bug

When a disabled option that is marked as "checked" should not be able to be uncheck once we click on it.

To Reproduce

Steps to reproduce the behavior:

on the Auro menu site you can add the attribute on one of the disabled and once you click on it it becomes unchecked.

https://user-images.githubusercontent.com/108018885/234120696-fdcbee7b-c624-4c4f-ba96-b06bd43db6d7.mov

Expected behavior

once an option is marked as checked and disabled should not become uncheck by clicking on itself. It should marked itself as uncheck if another element in the auro menu is clicked.

Additional context

We also do not have the capability to marked the entire menu as unchecked as in other components e.g auro-radio-group

blackfalcon commented 1 year ago

I can get on board that this is something to be supported when a menu item is pre-selected on paint and then the menu item is disabled. A user should not be able to uncheck that.

fajar-apri-alaska commented 1 year ago

Hi Team. This can be solved with below solution in handleMouseDown function like so:

image

Actually, I'm not sure where to put the checking condition. Maybe just combine it like:

image
blackfalcon commented 1 year ago

Thanks @fajar-apri-alaska we will look at this and see if we can get this issue prioritized.

braven112 commented 1 year ago

Notes from refinement: Double check that we are blocking keyboard as well as mouse for this bug as well.

fajar-apri-alaska commented 1 year ago

Notes from refinement: Double check that we are blocking keyboard as well as mouse for this bug as well.

You're right @braven112, I tried to force the focus to the disabled option with mouse click first, and press Enter, it did happened again. So instead of previous solution, in the makeSelection function we check if the target has disabled attribute, then it will do nothing.

image

Please advise.