Repository navigation
v0.188.0
Minor Changes
-
#1459
9ef6bb35Thanks @tenphi! - Thelabelproperty ofButton,ItemButton,ItemAction,ActionandInfoBadgeis deprecated, and passing it logs a one-time warning in development. Usechildrenfor a button's visible text andaria-labelfor the accessible name of an icon-only control.labelkeeps working where it worked before, butItemActionnever applied it, so an icon-onlyItemActionnamed only throughlabelhad no accessible name. Give it anaria-label(or a stringtooltip). ForAlertDialogactions andDialogForm'ssubmitProps/cancelProps, set the text withchildren, as inactions={{ confirm: { children: 'Delete' } }}. Alabelpassed there still wins over the default text. A dialog button given its ownchildrenand nolabelused to keep the default text as its accessible name (Submit,Ok,Cancel) while showing the consumer's text; its name now matches what it shows, so a test that queried such a button by the default name needs updating. A dialog button whoseiconis a function (({ loading }) => …) now always shows the default text beside it; passaria-labeland a staticiconfor an icon-only button. -
#1459
9ef6bb35Thanks @tenphi! -DataTable/ItemTable: a column'scellStylesnow go through tasty instead of the cell's inlinestyle. Tokens such as{ color: '#surface-text-soft-2' }, units, presets and state maps now take effect where they used to be dropped silently, and the column's styles win over the table's default cell paint, column tints and the table-levelcellStyles. On adataType: 'number'column, a function-formcellStylesis now called per cell and merged over the tabular figures; before, the numeric default replaced it. Values are now read as tasty rather than CSS, so check CSS-shaped ones: a side property such aspaddingLeft: 24ormarginTop: 8becomes the full shorthand with the other sides at 0 (use the CSS longhand with a unit,paddingInlineStart: '24px', to set one side); a bare number takes a unit on tasty's own properties (lineHeight: 1.2becomes1.2px, pass'1.2'for a unitless value) but stays unitless, and so invalid, on plain CSS ones (borderRadius: 4, pass'4px'or useradius); a plain color name insideborderoroutlineis dropped ('1px solid red', write'1px solid #red'); a React-style vendor key such asWebkitLineClampis read as a sub-element and dropped, so quote the CSS name ('-webkit-line-clamp': 2,'-webkit-box-orient': 'vertical'); andtextOverflow: 'ellipsis'also setsoverflow: hiddenandwhite-space: nowrap. -
#1459
9ef6bb35Thanks @tenphi! - -Tabs.ListacceptsqaandqaVal, applied asdata-qa/data-qavalon therole="tablist"element, so tests can select the tab list without relying on[data-element="TabList"].Tabsno longer setsaria-controlson the selected tab when that tab has no panel (navigation-only tabs, or a tab without content next to tabs that have it). The attribute used to point at a tabpanel id that nothing on the page had.Tabskeeps the active tab in view when the strip is mounted with a tab near its end active. The tab was scrolled into view before its actions (such as amenutrigger) were measured, so once every tab grew to its final width the active tab could end up past the edge of the strip or under a suffix button. The strip keeps following the active tab's size until the user interacts with the tab bar (wheel, pointer, touch or keyboard, which covers the scrollbar and the scroll arrows); after that a scrolled strip stays where the user left it.
-
#1459
9ef6bb35Thanks @tenphi! -ComboBoxandSearchComboBoxnow skip their built-in key handling for a key whoseonKeyDownhandler callse.preventDefault(), matchingTagInputandCommandTextArea. A preventedArrowDownno longer opens the popover, and a preventedEnterno longer selects an option, commits a custom value or callsonSubmit. A handler that calledpreventDefault()but still relied on the built-in handling for that key needs to drop the call.This changes one common pattern. On a
ComboBoxwithallowsCustomValueinside a form,onKeyDown={(e) => { if (e.key === 'Enter') e.preventDefault(); }}used to stop the form submit whileEnterstill committed the typed value. It now stops both, and the value is committed only on blur. To keep committing onEnter, commit it in the handler: controlselectedKeyand callsetSelectedKey(e.currentTarget.value.trim() || null)aftere.preventDefault().onKeyDownonComboBoxandSearchComboBoxis now typed with React Aria's keyboard event, the one it always received at runtime, soe.continuePropagation()type-checks. A handler annotated with React'sKeyboardEventstill type-checks, but code that calls the prop itself (a wrapper forwarding a native<input>event to it) must now pass React Aria's event.TextInput,TextArea,PasswordInputandNumberInputnow declareonKeyDownandonKeyUpin their own prop types, with the same signature as React Aria's keyboard handlers.
Patch Changes
-
#1459
9ef6bb35Thanks @tenphi! - Theno-redundant-default-proplint rule no longer flagsdisableActionsFocus={true}onItemas redundant. Its registry, like theItemdocs, listed the default astrue, while the component defaults tofalse. So the autofix removed a prop that was doing something, and the item's actions became focusable again. -
#1459
9ef6bb35Thanks @tenphi! -ItemButtonno longer rendersnavigationOptions(or the deprecatedlabel) as an attribute on its element. Navigation still receives the options, but the element also gotnavigationOptions="[object Object]", and React warned about an unknown prop in development. -
#1459
9ef6bb35Thanks @tenphi! - AMenu.SubMenuTriggerplaced inside aMenu.Sectionnow opens its submenu on hover and click, and its item shows the submenu arrow, as it does outside a section. Before, the item rendered as a plain item with no submenu. -
#1459
9ef6bb35Thanks @tenphi! - A popover opened from inside a modernDialogForm(one given aformcontroller), such as aPickerorFilterPickerlistbox or a menu, now closes on a click elsewhere in the dialog, instead of staying open until a click outside it. The form now opts out of popover dismissal for presses only, through the newdata-popover-keep-on-pressattribute, whichButtonandItemButtonhonour likedata-popover-keepwithout making a click in the subtree count as inside other popovers. -
#1459
9ef6bb35Thanks @tenphi! -TagInput: the chips grid, the show-options and clear buttons, and the options listbox are now named after the field when it is named byaria-labeloraria-labelledbyinstead of a visiblelabel. Witharia-labelledbythey read the same elements ("Selected values" followed by the field's name, and the listbox the name alone, no longer "Options"); anaria-labelis joined in ahead of those, in the input's own order, such as "Selected values, Region" or, witharia-labelledbyas well, "Selected values, Region Primary key". Fields without a visible label, such as one per table row, no longer all expose the same generic names.