tailwindcss-stimulus-components icon indicating copy to clipboard operation
tailwindcss-stimulus-components copied to clipboard

Support select dropdowns as a tab panel control mechanism

Open joshmfrankel opened this issue 3 years ago • 1 comments

When working with tabs, there are times when a different display is necessary for mobile view. Specifically, having a fallback select dropdown to make navigating tabs easier on mobile is required. This PR adds support for having a select element control the currently displayed panel. This mobile control can work in tandem with existing the data-tabs-target="tab" approach

select-demo

Reviewer notes:

  • I'm new to Typescript, so there are probably adjustments necessary
  • I wasn't able to make this work with jump to anchor

joshmfrankel avatar Apr 20 '22 15:04 joshmfrankel

Just want to throw my support behind this PR. I am a TailwindUI subscriber and was unable to implement the TailwindUI Tabs with tailwindcss-stimulus-components because of this exact issue.

What I experienced was, using data-tabs-target="tab" on each individual <select> <option> was working on Firefox but not on Chrome. Wasn't until I stumbled on this PR that I realised that dropdown menus wasn't supported. Thanks @joshmfrankel for your work on this and hoping it gets merged sometime soon :)

jaykilleen avatar Jan 10 '23 22:01 jaykilleen

This is available in v4

excid3 avatar Mar 14 '24 14:03 excid3