@dnd-kit/accessibility
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
.
A generic toolkit to help with accessibility
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.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"
.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.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.
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) {},
});
}
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.
c24bdb3
#184 Thanks @clauderic! - Tweaked LiveRegion component: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.role="status"
attribute to the LiveRegion wrapper element.white-space: no-wrap;
property to ensure that text does not wrap.423610c
#56 Thanks @clauderic! - Add MIT license to package.json and distributed files310bbd6
#37 Thanks @nickpresta! - Fix typo in package.json repository URL2912350
Thanks @clauderic! - Initial public release.7bd4568
#30 - Initial beta release, authored by @clauderic.