Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
282 stars 76 forks source link

bug: (@vtmn/svelte): VtmnListItem component tabindex yields the value false #1489

Open deviswamy1 opened 7 months ago

deviswamy1 commented 7 months ago

Describe the bug In the VtmnListItem component the anchor tag has a parameter tabindex which is validating with the value of disabled. If the disabled is true the tabindex is -1 but if the disabled is false the value of the tabindex is false instead 0. Please do the necessary changes

tabindex={disabled && -1} Steps to reproduce We can reproduce this in all decathlon search pages wherever the list is displayed

Expected behavior

Browsers affected

Version affected

GURURAJ8 commented 1 month ago

Actually && doesn't work that way. You can use a ternary operator {disabled? 0:-1}, instead.