Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.1k stars 4.95k forks source link

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

Open inspector71 opened 1 year ago

inspector71 commented 1 year ago

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 commented 1 year ago

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 :)

igABHINAV commented 3 months ago

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