Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@qwik-ui/[email protected]
Minor Changes
Combobox v2, New Dropdown Component, and Progress bar reaches beta! (by @thejackshelton in #838)
0.5 continues our move towards a 1.0 release. It includes a few breaking changes to the Combobox in order to make sure that the components have a clear API.
Below is a migration guide of API's for the Combobox.
Combobox
The combobox has been refactored from the ground up, including new features, components, and QOL updates.
Anatomy changes
The new Combobox anatomy is as follows:
Anatomy Changes
Combobox.Option has been renamed to Combobox.Item:
Combobox.ItemLabelcomponent to display the item's label, which becomes the item's value if novalueprop is passed to theCombobox.Item. (required)Combobox.Listbox has been deprecated.
Combobox.ItemLabel has been added:
Combobox.OptionintoCombobox.ItemLabel. (required)Combobox.ItemIndicator has been added:
Combobox.Description has been added:
Combobox.ErrorMessage has been added:
Combobox.HiddenNativeSelect has been added:
Combobox.Group has been added:
Combobox.GroupLabel has been added:
Combobox.Empty has been added:
Combobox.Emptycomponent is rendered. (optional)API Changes
Rendering Items (required)
The
optionRenderer# Changelog prop on theCombobox.Listbox` component has been deprecated.Instead:
<Combobox.Item />as a child of the<Combobox.Popover />component.Combobox.ItemLabelas a child of the<Combobox.Item />component.It should look something like this:
You are now in full control of how the item is rendered. Because you control the rendering of the item, there is no need for the previous API's including the data's key values.
There is also no need to pass an
indexprop to theCombobox.Itemcomponent. It is handled automatically.Pass in distinct values
The
valueprop has been added to theCombobox.Itemcomponent to allow for passing in a distinct value for the combobox.For example, identifying a user by their ID, rather than the display username.
Add your own filter
Filters are an important part of the combobox. It was a design decision in this refactor to make filtering data as easy as possible to integrate with other tools and libraries.
The
filter# Changelog prop has been replaced. Instead, items are by default filtered by theincludes` function.To opt-out of the default filter, add the
filter={false}prop to theCombobox.Rootcomponent, which will disable the default filter.The above example uses the
matchSorterfunction from thematch-sorterlibrary to filter the items.bind:valueinstead ofbind:selectedIndexbind:value has been added in favor of what was previously used to reactively control the combobox, bind:selectedIndex.
onChange# Changelog has been added to theCombobox.Root` component so that you can listen to when the selected value changes.Add initial values to the combobox
The
valueprop has been added to theCombobox.Rootcomponent to select the initial value of the combobox when it is rendered.Input state management
bind:inputValue(on the Root) has been replaced by using thebind:valueprop on the<Combobox.Input />component instead.You can also now listen to when the input value changes by using the
onInput# Changelog prop on the<Combobox.Root />` component.Passing refs to the combobox (experimental)
The combobox is the first component to support passing refs! You can now pass a ref of your own to any component inside the combobox. This is an experimental feature, and we are still working on it, use at your own risk.
Multiple selections
You can now select multiple items by passing the
multipleprop to the<Combobox.Root />component.removeOnBackspace
When in multiple selection mode, and the
removeOnBackspaceprop has been added to theCombobox.Rootcomponent, selected items can be removed by pressing the backspace key. (when the input is empty)Managing display values
bind:displayValuehas been added to theCombobox.Rootcomponent to allow for grabbing the updated display values of the combobox.Item indicators
The item indicator shows when the item is selected. Inside can be the UI of choice.
bind:openinstead ofbind:isListboxOpenbind:open has been added to control the open state of the listbox, replacing bind:isListboxOpen.
onOpenChange# Changelog has been added to theCombobox.Root` component so that you can listen to when the popup opens or closes.Focus State Management
bind:isInputFocused has been deprecated. Instead, if you decide to manage focus state using event handlers like onFocus$ and onBlur$. OR pass a ref to the
Combobox.Inputcomponent.Placeholders
The placeholder prop has been added to the
Combobox.Rootcomponent to allow for a custom placeholder.Environment
Like many of the latest components in Qwik UI, each function of the Combobox has been optimized to run in both SSR or CSR automatically depending on the environment.
Looping
Looping is now opt-in by default. To enable looping, add the
loopprop to theCombobox.Rootcomponent.Scrolling
When a scrollbar is present, the combobox will now properly scroll to the selected item. The scroll behavior can be customized using the
scrollOptionsprop on theCombobox.Rootcomponent.Forms
The Combobox now supports form submissions. To enable this:
nameprop to theCombobox.Rootcomponent, with the name of the Combobox form field.<Combobox.HiddenNativeSelect />component inside of the<Combobox.Root />component.Validation
The Combobox now supports validation. It was a design decision to make validation as easy as possible to integrate with other tools and libraries, such as Modular Forms.
A component is invalid when the
Combobox.ErrorMessagecomponent is rendered. This component provides an accessible description of the error to assistive technologies.Floating / Top layer items
The props previously on the
Combobox.Listbox, have been moved to theCombobox.Popovercomponent to be more consistent with the rest of the Qwik UI components.placementhas been deprecated in favor offloating, which can be a boolean or the direction of the floating element.autoPlacementhas been removed, asflipshould be used instead.Ex:
floating={true}orfloating="top"Keyboard interactions
Key
Description
The Enter key will toggle the selection of the highlighted item without closing the combobox if an item is already selected, otherwise it will close the popup.
Multi Select
When in multi select mode, additional keyboard interactions are available.
Data Attributes
data-invalidis added to the combobox when the combobox is invalid.data-openis added to the combobox when the combobox is open.data-closedis added to the combobox when the combobox is closed.data-highlightedis added to the combobox item when the item is highlighted.data-selectedis added to the combobox item when the item is selected.data-disabledis added to the combobox item when the item is disabled.Accessibility
Announcements to the Combobox are more consistent and follow the WAI-ARIA Combobox design pattern.
So far, the Combobox has been tested with VoiceOver, Axe, and NVDA.
Select
The select component also includes some improvments
Accessibility
Announcements to the Select are more consistent and follow the WAI-ARIA Listbox design pattern.
So far, the Select has been tested with VoiceOver, Axe, and NVDA.
Dropdown
A new component has been added to Qwik UI, the Dropdown. It is currently in a draft state, and is not yet ready for production use. We will be working on it more deeply in the near future.
Anatomy
Here is the initial API:
Feel free to play around with it! Feedback is very appreciated.
Progress Bar
The progress bar has been around for a while, it has finally reached a beta state, make sure to open an issue on the Qwik UI repo if you run into any problems.
Patch Changes
Enable select item indicator styling by passing down properties (by @juanpmarin in #857)
We are adding the final set of popover tests. With this we should now have full coverage for both current and legacy browsers. (by @cwoolum in #831)
🐞🩹 Only run single modal close step (by @RumNCodeDev in #845)
Chromium 109-113 did not properly support the popover but reported that they did. This led to the polyfill not activating which caused our E2E tests to break. We are dropping down to Chromium 108 to validate the polyfill as users of Chrome would see it before the popover API was supported. (by @cwoolum in #827)
[email protected]
Patch Changes
tailwindcss-animate,class-variance-authority(by @shairez in #872)and
@qwikest/iconsduring the cli init