Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

[Dropdown] - `allowTab` `tabindex` value should default to `select`'s `tabindex` (if exists)

Open inspector71 opened this issue 3 years ago • 2 comments

Steps to Reproduce

  1. Integrate Dropdown only via /dist/components/dropdown.min.js; /dist/components/dropdown.min.css
  2. Initialize on existing, traditional HTML select (with options etc) with an existing tabindex attribute, using ui search selection class 'triggers' and $('element').dropdown()

Expected Dropdown created with tabindex value copied from existing select element's tabindex value.

Result Dropdown created with tabindex="0"

Relevant line appears to be:

https://github.com/Semantic-Org/Semantic-UI/blob/daa2438f048e6d98a330171a83ec74c3a13e9bd1/src/definitions/modules/dropdown.js#L2266

inspector71 avatar Nov 26 '22 02:11 inspector71

Slapdash 'solution':

.attr('tabindex', element.attributes.tabindex.value)

No doubt for wider use requires a little more refinement. Will submit PR if/when I can :)

inspector71 avatar Nov 26 '22 03:11 inspector71

Please checkout my pull request : Fixed issue #7100 : [Dropdown] - allowTab tabindex value should default to select's tabindex (if exists) #7100

igABHINAV avatar Jun 17 '24 09:06 igABHINAV