Repository navigation
v0.195.0
Minor Changes
-
#1523
27d221cdThanks @tenphi! - A dialog opened withuseAlertDialogAPI()now belongs to the component that called the hook and closes, as a cancel, when that component unmounts, so its callbacks no longer run against a component that is gone.onCancelruns and the promise rejects withundefined, as for an abortedcancelToken. A call toopenafter the unmount settles as a cancel without opening. Call the hook in a component that stays mounted while the dialog is open: a dialog opened by a menu item that unmounts when the menu closes now closes with it, so call the hook in the component that renders the menu. When the unmount or an abortedcancelTokencomes while a confirm or secondary action is running, the action now finishes first: the dialog closes with its result, or as a cancel if it fails. -
#1523
27d221cdThanks @tenphi! - A field without alabelnow shows itsdescription,errorMessageandmessageinstead of dropping them, and links them to the input, so a screen reader says why it is invalid. A label-less field bound to a form (with aname, or as the child of a legacyForm.Item) gets the same field wrapper, so its validation errors show under it.SearchInputandSearchComboBoxnow show their texts too. Passing one of these props is enough, whatever it holds at the moment (errorMessage={error}witherrorstillundefinedornull), so the input keeps its place and its focus when the message comes and goes. The field is then laid out by its wrapper, as a labelled one is: layout props such asflexGrow,widthorgridAreastay on the input, so move them tofieldStyles. For an inline field, the newisBareprop keeps the bare control: its texts are not shown, and the control keeps its invalid state. Without a label, a description now goes under the input even with a side or splitlabelPosition, rather than in the empty label column.forceFieldis deprecated: such fields no longer need it. It still forces the wrapper and warns once in development; remove it.
Patch Changes
-
#1523
27d221cdThanks @tenphi! -CheckboxandSwitchfixes. A standaloneCheckboxnow gets thehoveredmod, and a grouped one now puts its state mods (checked,disabled,invalid,hovered, …) on its wrapper, sostyleskeyed on them work in both. A stringlabelno longer replaces the inline text or youraria-labelin aCheckbox's accessible name:<Checkbox label="Notifications">Send me emails</Checkbox>is named "Notifications Send me emails", as aSwitchalready was. ACheckboxin a group no longer copies itsid,aria-*anddata-*props onto its wrapper, so#id,<label for>andaria-labelledbyreach the input; both a standalone and a grouped one now passclassName,style,qaValand your ownmodsto the wrapper. ASwitchlabel now wraps instead of staying on one line. ACheckboxorSwitchnamed only by a fieldlabelno longer logs React Aria's missingaria-labelwarning. -
#1515
68d2508fThanks @tenphi! -Layout.PanewithflexShrink={1}now resizes correctly when other panes in the same flex container also give way. The edge follows the pointer and moves exactly 10px per arrow key (50px with Shift) instead of losing part of each move to the panes beside it, and the pane stays where it is dropped. The room comes from the panes after the edge, down to theirminSize, where the resize stops; the panes before the edge keep their size. A pane that gives way keeps the size it was left at and reports it throughonSizeChange. Beside such panes, a resize that ends where it began, such as an arrow key pressed at the stop, leaves every pane as it was and reports nothing. A drag only across a pane's grip, or a key across it outside a drag, no longer reports a size change. -
#1523
27d221cdThanks @tenphi! - A form-boundCheckboxorSwitchkeeps thevalueyou give it. It used to rendervalue="true"orvalue="false"as soon as the field had a value, so a native<Form action>submission andFormDataread the boolean instead ofvalue="yes"; without avalue, a checked one now submits the browser defaulton. The same change stops a custom control built onuseFieldPropsfrom receiving the field value asvaluewhen itsvaluePropsMappermaps it to another prop.