Détail du package

@dnd-kit/accessibility

clauderic13.5mMIT3.1.1

A generic toolkit to help with accessibility

readme

@dnd-kit/accessibility

Stable release

A generic set of components and hooks to help with live region announcements and screen reader instructions. This package is used internally by @dnd-kit/core.

changelog

@dnd-kit/accessibility

3.1.1

Patch Changes

  • #1534 93602df Thanks @duvallj! - Workaround <LiveRegion> layout bug by adding explicit top and left attributes. Under sufficiently complex CSS conditions, the element would overflow containers that it's not supposed to. See this post for a complete explanation.

3.1.0

Minor Changes

  • #1229 aabb8bd Thanks @ayy-bc! - Introduce ariaLiveType prop on <LiveRegion> to allow consumers to configure the aria-live attribute to other values for announcements, such as aria-live="polite".

3.0.1

Patch Changes

  • #776 3978c43 Thanks @clauderic! - The ARIA live region element used for screen reader announcements is now positioned using position: fixed instead of position: absolute. As of @dnd-kit/core^6.0.0, the live region element is no longer portaled by default into the document.body. This change was introduced in order to fix issues with portaled live regions. However, this change can introduce visual regressions when using absolutely positioned elements, since the live region element is constrained to the stacking and position context of its closest positioned ancestor. Using fixed position ensures the element does not introduce visual regressions.

3.0.0

Major Changes

  • a9d92cf #174 Thanks @clauderic! - Distributed assets now only target modern browsers. Browserlist config:

    defaults
    last 2 version
    not IE 11
    not dead
    

    If you need to support older browsers, include the appropriate polyfills in your project's build process.

Patch Changes

  • b406cb9 #187 Thanks @clauderic! - Introduced the useDndMonitor hook. The useDndMonitor hook can be used within components wrapped in a DndContext provider to monitor the different drag and drop events that happen for that DndContext.

    Example usage:

    import {DndContext, useDndMonitor} from '@dnd-kit/core';
    
    function App() {
      return (
        <DndContext>
          <Component />
        </DndContext>
      );
    }
    
    function Component() {
      useDndMonitor({
        onDragStart(event) {},
        onDragMove(event) {},
        onDragOver(event) {},
        onDragEnd(event) {},
        onDragCancel(event) {},
      });
    }
    

2.0.0

Major Changes

  • 2833337 #186 Thanks @clauderic! - Simplify useAnnouncement hook to only return a single announcement rather than entries. Similarly, the LiveRegion component now only accepts a single announcement rather than `entries.

    • The current strategy used in the useAnnouncement hook is needlessly complex. It's not actually necessary to render multiple announcements at once within the LiveRegion component. It's sufficient to render a single announcement at a time. It's also un-necessary to clean up the announcements after they have been announced, especially now that the role="status" attribute has been added to LiveRegion, keeping the last announcement rendered means users can refer to the last status.

Patch Changes

  • c24bdb3 #184 Thanks @clauderic! - Tweaked LiveRegion component:
    • Entries are now rendered without wrapper span elements. Having wrapper span elements causes VoiceOver on macOS to try to move the VoiceOver cursor to the live region, which interferes with scrolling. This issue is not exhibited when rendering announcement entries as plain text without wrapper spans.
    • Added the role="status" attribute to the LiveRegion wrapper element.
    • Added the white-space: no-wrap; property to ensure that text does not wrap.

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

0.1.0

Minor Changes