github chakra-ui/zag @zag-js/slider@2.0.0-next.4

Major Changes

  • #3342
    d6089c3 Thanks
    @github-actions! - - Breaking: Replace the aria-label and
    aria-labelledby array props with getAriaLabel and getAriaLabelledBy, matching getAriaValueText.

      slider.machine({
    -   "aria-label": ["Minimum price", "Maximum price"],
    +   getAriaLabel: ({ index }) => (index === 0 ? "Minimum price" : "Maximum price"),
      })
    • Breaking: Leave a disabled slider out of form submission, like a native input.

    • Add disabled to getThumbProps and getHiddenInputProps to disable a single thumb.

    • Add inRange to the marker state and data-in-range to markers within the filled range.

    • Accept a single number for thumbSize, setting both width and height.

    • Add aria-readonly to the thumbs when readOnly is set, and aria-invalid and data-invalid when invalid.

    • Fix thumbs with their own label getting aria-labelledby pointing at the label part.

    • Fix the range falling short of the thumb's center when thumbAlignment is "contain".

    • Fix onValueChangeEnd firing when an interaction ends on the starting value.

    • Fix Page Up, Page Down and Shift + Arrow snapping to multiples of largeStep instead of moving by it.

    • Fix stacked thumbs getting stuck when thumbCollisionBehavior is "none".

Minor Changes

  • #3342
    4f28f36 Thanks
    @github-actions! - - Add reason to onValueChange details, such as
    trigger-click, keyboard, drag, item-select or script. Each component exports its ValueChangeReason type.
    Slider also adds it to onValueChangeEnd.

Patch Changes

  • #3342
    730ea29 Thanks
    @github-actions! - - Fix focus, scroll and sync work scheduled for the next
    frame running after the component unmounts.
  • Updated dependencies [a80b307]:
    • @zag-js/dom-query@2.0.0-next.4
    • @zag-js/core@2.0.0-next.4
    • @zag-js/anatomy@2.0.0-next.4
    • @zag-js/types@2.0.0-next.4
    • @zag-js/utils@2.0.0-next.4

Don't miss a new zag release

NewReleases is sending notifications on new releases.