Skip to content

Releases: thisbeyond/solid-select

Release 0.14.0

09 Apr 18:43
Compare
Choose a tag to compare

A major refactor to more clearly separate out the core and the builtin
components. The builtin Select and accompanying component interfaces remains
unchanged, but there are backwards incompatible changes to the createSelect
interface.

Changed

  • Breaking Change Streamline the core and allow greater control in
    components. No longer pass or use element refs in the core, including not
    automatically settign up event handlers. Instead, return commonly useful
    handlers (such as onKeyDown) from createSelect for use in components.

  • Breaking Change Expose signals directly as accessors rather than hiding
    behind property getters in return of createSelect. For example,
    select.options should now be select.options(). This more closely matches
    SolidJS and avoids inconsistency around not being able to set properties
    directly.

  • Breaking Change Remove helpers (such as open and close) in favour of
    exposing setters (e.g. setIsOpen) consistently from createSelect. This
    provides a more intuitive interface rather than some aspects having helpers
    and others not.

  • Breaking Change Refactor Select components to make use of a shared
    Context providing the created select. Avoid unnecessary prop drilling and
    make it easier to others to compose their own selects (with useSelect).

  • Breaking Change Make createAsyncOptions throttle by default. The fetcher
    will be called every 250ms by default to prevent excessive calls to resources.
    The threshold can be configured or removed by passing a second argument - e.g.
    createAsyncOptions(fetcher, 0) for original behaviour.

  • Hide the input caret with CSS rather than hide the entire input component to
    make some logic easier (such as focus handling).

Fixed

  • Allow repositioning the cursor on active input text. Previously, attempting to
    do this would clear the input value.

Release 0.13.0

12 Sep 20:32
Compare
Choose a tag to compare

Changed

  • Breaking Change Support Solid JS 1.5 as the minimum compatible version and
    update relevant typings.

Release 0.12.0

29 Jul 21:04
Compare
Choose a tag to compare

Changed

  • React to changing initialValue even if initially undefined on Select
    component.

Fixed

  • Fix onFocus prop being ignored by Select component. It now passes it
    through to the core and is called correctly when the select is focused. Thanks
    to kapilpipaliya for the fix.

Release 0.11.0

26 May 22:07
Compare
Choose a tag to compare

Changed

  • Change initialValue behaviour on the Select component to react to signals
    in a more intuitive way. Rather than pass the raw signal in, use the resolved
    signal in a tracking context to gain reactivity for the initialValue. This
    is the recommended approach to passing Signals in Solid (and is also more
    similar to plain values).

    <Select initialValue={initialValue}/>

    becomes

    <Select initialValue={initialValue()}/>

    Thanks to rturnq for the tip!

Release 0.10.0

26 May 19:20
Compare
Choose a tag to compare

Added

  • Accept emptyPlaceholder property on Select to control the message
    displayed when there are no options available. Defaults to No options.
    Thanks to @raskyer for this contribution.

  • The initialValue prop of the Select component can now be a Signal in order
    to support reactively re-setting the initial value of the component. This is
    useful for providing 'reset form' functionality for example.

    const [initialValue, setInitialValue] = createSignal(null, { equals: false });
    
    <Select
      initialValue={initialValue}
      options={["apple", "banana", "pear", "pineapple", "kiwi"]}
    />
    
    <button onClick={() => setInitialValue(null)}>Reset</button>

Release 0.9.0

09 Apr 14:49
Compare
Choose a tag to compare

Added

  • Auto scroll focused options into view. As part of this, also set sensible
    default styles for overflow and maximum height of solid-select-list.

Release 0.8.0

02 Apr 20:32
Compare
Choose a tag to compare

Added

  • Provide a helper, createAsyncOptions for loading options asynchronously
    based on input value. Uses Solid's createResource under the hood.

    const fetchData = async (inputValue) => { return await ... }
    
    const props = createAsyncOptions(fetchData);
    return <Select {...props} />;
  • Support displaying a loading indicator in the options lists - useful when
    fetching options asynchronously. Pass the loading prop to the Select
    component to control whether to display the loading indicator or the list of
    options. Customise the loading message with the loadingPlaceholder prop.

Release 0.7.1

23 Mar 18:08
Compare
Choose a tag to compare

Fixed

  • Fix import error (Failed to resolve import "virtual:windi.css") when using
    'solid' export source in another SolidJS project that does not use WindiCSS.
    Strip the relevant import line post build as it is not needed in the
    distributed package (the styles are already compiled and available via import "@thisbeyond/solid-select/style.css";).

Release 0.7.0

17 Mar 15:52
Compare
Choose a tag to compare

Added

  • Support disabling select by passing boolean value for disabled prop (both in
    createSelect or the Select component). When disabled no interaction is
    permitted. The component is visually styled based on the data-disabled
    attribute.

    <Select disabled options={["one", "two", "three"]} />

Fixed

  • Ensure control is focused even when clicking on extremities of container.

Release 0.6.0

24 Feb 22:38
Compare
Choose a tag to compare

Added

  • Add builtin fuzzy search and sort algorithm. Use as default for filtering in
    createOptions. This replaces the previous filtering logic that could only
    match exact segments and was case sensitive. The new algorithm is case
    insensitive, can match multiple partials and prioritises start of string /
    start of word / consecutive matches. When sorting, if two matches have the
    same score then their original array index is used as the tiebreaker.

    sorted = fuzzySort("spp", ["pineapple", "rose apple",  "star apple"])
    // [{ target: "star apple", ... }, { target: "rose apple", ... }]

    A helper to highlight matches is also included:

    highlighted = fuzzyHighlight(sorted[0])
    // <><mark>s</mark>tar a<mark>pp</mark>le</>

Changed

  • Mark package as side effect free.