@react-aria/focus 3.5.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +548 -831
- package/dist/main.js.map +1 -1
- package/dist/module.js +531 -786
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +169 -169
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/FocusScope.tsx +8 -7
package/dist/types.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ interface _FocusRingProps1 {
|
|
|
113
113
|
* Focus rings are visible only when the user is interacting with a keyboard,
|
|
114
114
|
* not with a mouse, touch, or other input methods.
|
|
115
115
|
*/
|
|
116
|
-
export function FocusRing(props: _FocusRingProps1): React.ReactElement<any, string |
|
|
116
|
+
export function FocusRing(props: _FocusRingProps1): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
117
117
|
interface FocusableOptions extends FocusableProps, FocusableDOMProps {
|
|
118
118
|
/** Whether focus should be disabled. */
|
|
119
119
|
isDisabled?: boolean;
|
|
@@ -138,7 +138,7 @@ export function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElem
|
|
|
138
138
|
suppressHydrationWarning?: boolean;
|
|
139
139
|
accessKey?: string;
|
|
140
140
|
className?: string;
|
|
141
|
-
contentEditable?:
|
|
141
|
+
contentEditable?: "inherit" | (boolean | "false" | "true");
|
|
142
142
|
contextMenu?: string;
|
|
143
143
|
dir?: string;
|
|
144
144
|
draggable?: boolean | "false" | "true";
|
|
@@ -150,9 +150,9 @@ export function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElem
|
|
|
150
150
|
spellCheck?: boolean | "false" | "true";
|
|
151
151
|
style?: React.CSSProperties;
|
|
152
152
|
title?: string;
|
|
153
|
-
translate?: "
|
|
153
|
+
translate?: "yes" | "no";
|
|
154
154
|
radioGroup?: string;
|
|
155
|
-
role?:
|
|
155
|
+
role?: React.AriaRole;
|
|
156
156
|
about?: string;
|
|
157
157
|
datatype?: string;
|
|
158
158
|
inlist?: any;
|
|
@@ -173,18 +173,18 @@ export function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElem
|
|
|
173
173
|
results?: number;
|
|
174
174
|
security?: string;
|
|
175
175
|
unselectable?: "on" | "off";
|
|
176
|
-
inputMode?: "search" | "
|
|
176
|
+
inputMode?: "search" | "numeric" | "none" | "url" | "text" | "tel" | "email" | "decimal";
|
|
177
177
|
is?: string;
|
|
178
178
|
'aria-activedescendant'?: string;
|
|
179
179
|
'aria-atomic'?: boolean | "false" | "true";
|
|
180
|
-
'aria-autocomplete'?: "
|
|
180
|
+
'aria-autocomplete'?: "inline" | "both" | "none" | "list";
|
|
181
181
|
'aria-busy'?: boolean | "false" | "true";
|
|
182
182
|
'aria-checked'?: boolean | "mixed" | "false" | "true";
|
|
183
183
|
'aria-colcount'?: number;
|
|
184
184
|
'aria-colindex'?: number;
|
|
185
185
|
'aria-colspan'?: number;
|
|
186
186
|
'aria-controls'?: string;
|
|
187
|
-
'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "
|
|
187
|
+
'aria-current'?: boolean | "location" | "time" | "page" | "false" | "true" | "step" | "date";
|
|
188
188
|
'aria-describedby'?: string;
|
|
189
189
|
'aria-details'?: string;
|
|
190
190
|
'aria-disabled'?: boolean | "false" | "true";
|
|
@@ -193,7 +193,7 @@ export function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElem
|
|
|
193
193
|
'aria-expanded'?: boolean | "false" | "true";
|
|
194
194
|
'aria-flowto'?: string;
|
|
195
195
|
'aria-grabbed'?: boolean | "false" | "true";
|
|
196
|
-
'aria-haspopup'?: boolean | "
|
|
196
|
+
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "false" | "true" | "tree";
|
|
197
197
|
'aria-hidden'?: boolean | "false" | "true";
|
|
198
198
|
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling";
|
|
199
199
|
'aria-keyshortcuts'?: string;
|
|
@@ -218,7 +218,7 @@ export function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElem
|
|
|
218
218
|
'aria-rowspan'?: number;
|
|
219
219
|
'aria-selected'?: boolean | "false" | "true";
|
|
220
220
|
'aria-setsize'?: number;
|
|
221
|
-
'aria-sort'?: "none" | "
|
|
221
|
+
'aria-sort'?: "none" | "other" | "ascending" | "descending";
|
|
222
222
|
'aria-valuemax'?: number;
|
|
223
223
|
'aria-valuemin'?: number;
|
|
224
224
|
'aria-valuenow'?: number;
|
|
@@ -227,166 +227,166 @@ export function useFocusable(props: FocusableOptions, domRef: RefObject<HTMLElem
|
|
|
227
227
|
dangerouslySetInnerHTML?: {
|
|
228
228
|
__html: string;
|
|
229
229
|
};
|
|
230
|
-
onCopy?:
|
|
231
|
-
onCopyCapture?:
|
|
232
|
-
onCut?:
|
|
233
|
-
onCutCapture?:
|
|
234
|
-
onPaste?:
|
|
235
|
-
onPasteCapture?:
|
|
236
|
-
onCompositionEnd?:
|
|
237
|
-
onCompositionEndCapture?:
|
|
238
|
-
onCompositionStart?:
|
|
239
|
-
onCompositionStartCapture?:
|
|
240
|
-
onCompositionUpdate?:
|
|
241
|
-
onCompositionUpdateCapture?:
|
|
242
|
-
onFocus?:
|
|
243
|
-
onFocusCapture?:
|
|
244
|
-
onBlur?:
|
|
245
|
-
onBlurCapture?:
|
|
246
|
-
onChange?:
|
|
247
|
-
onChangeCapture?:
|
|
248
|
-
onBeforeInput?:
|
|
249
|
-
onBeforeInputCapture?:
|
|
250
|
-
onInput?:
|
|
251
|
-
onInputCapture?:
|
|
252
|
-
onReset?:
|
|
253
|
-
onResetCapture?:
|
|
254
|
-
onSubmit?:
|
|
255
|
-
onSubmitCapture?:
|
|
256
|
-
onInvalid?:
|
|
257
|
-
onInvalidCapture?:
|
|
258
|
-
onLoad?:
|
|
259
|
-
onLoadCapture?:
|
|
260
|
-
onError?:
|
|
261
|
-
onErrorCapture?:
|
|
262
|
-
onKeyDown?:
|
|
263
|
-
onKeyDownCapture?:
|
|
264
|
-
onKeyPress?:
|
|
265
|
-
onKeyPressCapture?:
|
|
266
|
-
onKeyUp?:
|
|
267
|
-
onKeyUpCapture?:
|
|
268
|
-
onAbort?:
|
|
269
|
-
onAbortCapture?:
|
|
270
|
-
onCanPlay?:
|
|
271
|
-
onCanPlayCapture?:
|
|
272
|
-
onCanPlayThrough?:
|
|
273
|
-
onCanPlayThroughCapture?:
|
|
274
|
-
onDurationChange?:
|
|
275
|
-
onDurationChangeCapture?:
|
|
276
|
-
onEmptied?:
|
|
277
|
-
onEmptiedCapture?:
|
|
278
|
-
onEncrypted?:
|
|
279
|
-
onEncryptedCapture?:
|
|
280
|
-
onEnded?:
|
|
281
|
-
onEndedCapture?:
|
|
282
|
-
onLoadedData?:
|
|
283
|
-
onLoadedDataCapture?:
|
|
284
|
-
onLoadedMetadata?:
|
|
285
|
-
onLoadedMetadataCapture?:
|
|
286
|
-
onLoadStart?:
|
|
287
|
-
onLoadStartCapture?:
|
|
288
|
-
onPause?:
|
|
289
|
-
onPauseCapture?:
|
|
290
|
-
onPlay?:
|
|
291
|
-
onPlayCapture?:
|
|
292
|
-
onPlaying?:
|
|
293
|
-
onPlayingCapture?:
|
|
294
|
-
onProgress?:
|
|
295
|
-
onProgressCapture?:
|
|
296
|
-
onRateChange?:
|
|
297
|
-
onRateChangeCapture?:
|
|
298
|
-
onSeeked?:
|
|
299
|
-
onSeekedCapture?:
|
|
300
|
-
onSeeking?:
|
|
301
|
-
onSeekingCapture?:
|
|
302
|
-
onStalled?:
|
|
303
|
-
onStalledCapture?:
|
|
304
|
-
onSuspend?:
|
|
305
|
-
onSuspendCapture?:
|
|
306
|
-
onTimeUpdate?:
|
|
307
|
-
onTimeUpdateCapture?:
|
|
308
|
-
onVolumeChange?:
|
|
309
|
-
onVolumeChangeCapture?:
|
|
310
|
-
onWaiting?:
|
|
311
|
-
onWaitingCapture?:
|
|
312
|
-
onAuxClick?:
|
|
313
|
-
onAuxClickCapture?:
|
|
314
|
-
onClick?:
|
|
315
|
-
onClickCapture?:
|
|
316
|
-
onContextMenu?:
|
|
317
|
-
onContextMenuCapture?:
|
|
318
|
-
onDoubleClick?:
|
|
319
|
-
onDoubleClickCapture?:
|
|
320
|
-
onDrag?:
|
|
321
|
-
onDragCapture?:
|
|
322
|
-
onDragEnd?:
|
|
323
|
-
onDragEndCapture?:
|
|
324
|
-
onDragEnter?:
|
|
325
|
-
onDragEnterCapture?:
|
|
326
|
-
onDragExit?:
|
|
327
|
-
onDragExitCapture?:
|
|
328
|
-
onDragLeave?:
|
|
329
|
-
onDragLeaveCapture?:
|
|
330
|
-
onDragOver?:
|
|
331
|
-
onDragOverCapture?:
|
|
332
|
-
onDragStart?:
|
|
333
|
-
onDragStartCapture?:
|
|
334
|
-
onDrop?:
|
|
335
|
-
onDropCapture?:
|
|
336
|
-
onMouseDown?:
|
|
337
|
-
onMouseDownCapture?:
|
|
338
|
-
onMouseEnter?:
|
|
339
|
-
onMouseLeave?:
|
|
340
|
-
onMouseMove?:
|
|
341
|
-
onMouseMoveCapture?:
|
|
342
|
-
onMouseOut?:
|
|
343
|
-
onMouseOutCapture?:
|
|
344
|
-
onMouseOver?:
|
|
345
|
-
onMouseOverCapture?:
|
|
346
|
-
onMouseUp?:
|
|
347
|
-
onMouseUpCapture?:
|
|
348
|
-
onSelect?:
|
|
349
|
-
onSelectCapture?:
|
|
350
|
-
onTouchCancel?:
|
|
351
|
-
onTouchCancelCapture?:
|
|
352
|
-
onTouchEnd?:
|
|
353
|
-
onTouchEndCapture?:
|
|
354
|
-
onTouchMove?:
|
|
355
|
-
onTouchMoveCapture?:
|
|
356
|
-
onTouchStart?:
|
|
357
|
-
onTouchStartCapture?:
|
|
358
|
-
onPointerDown?:
|
|
359
|
-
onPointerDownCapture?:
|
|
360
|
-
onPointerMove?:
|
|
361
|
-
onPointerMoveCapture?:
|
|
362
|
-
onPointerUp?:
|
|
363
|
-
onPointerUpCapture?:
|
|
364
|
-
onPointerCancel?:
|
|
365
|
-
onPointerCancelCapture?:
|
|
366
|
-
onPointerEnter?:
|
|
367
|
-
onPointerEnterCapture?:
|
|
368
|
-
onPointerLeave?:
|
|
369
|
-
onPointerLeaveCapture?:
|
|
370
|
-
onPointerOver?:
|
|
371
|
-
onPointerOverCapture?:
|
|
372
|
-
onPointerOut?:
|
|
373
|
-
onPointerOutCapture?:
|
|
374
|
-
onGotPointerCapture?:
|
|
375
|
-
onGotPointerCaptureCapture?:
|
|
376
|
-
onLostPointerCapture?:
|
|
377
|
-
onLostPointerCaptureCapture?:
|
|
378
|
-
onScroll?:
|
|
379
|
-
onScrollCapture?:
|
|
380
|
-
onWheel?:
|
|
381
|
-
onWheelCapture?:
|
|
382
|
-
onAnimationStart?:
|
|
383
|
-
onAnimationStartCapture?:
|
|
384
|
-
onAnimationEnd?:
|
|
385
|
-
onAnimationEndCapture?:
|
|
386
|
-
onAnimationIteration?:
|
|
387
|
-
onAnimationIterationCapture?:
|
|
388
|
-
onTransitionEnd?:
|
|
389
|
-
onTransitionEndCapture?:
|
|
230
|
+
onCopy?: React.ClipboardEventHandler<HTMLElement>;
|
|
231
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLElement>;
|
|
232
|
+
onCut?: React.ClipboardEventHandler<HTMLElement>;
|
|
233
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLElement>;
|
|
234
|
+
onPaste?: React.ClipboardEventHandler<HTMLElement>;
|
|
235
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLElement>;
|
|
236
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLElement>;
|
|
237
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLElement>;
|
|
238
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLElement>;
|
|
239
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLElement>;
|
|
240
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLElement>;
|
|
241
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLElement>;
|
|
242
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
243
|
+
onFocusCapture?: React.FocusEventHandler<HTMLElement>;
|
|
244
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
245
|
+
onBlurCapture?: React.FocusEventHandler<HTMLElement>;
|
|
246
|
+
onChange?: React.FormEventHandler<HTMLElement>;
|
|
247
|
+
onChangeCapture?: React.FormEventHandler<HTMLElement>;
|
|
248
|
+
onBeforeInput?: React.FormEventHandler<HTMLElement>;
|
|
249
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLElement>;
|
|
250
|
+
onInput?: React.FormEventHandler<HTMLElement>;
|
|
251
|
+
onInputCapture?: React.FormEventHandler<HTMLElement>;
|
|
252
|
+
onReset?: React.FormEventHandler<HTMLElement>;
|
|
253
|
+
onResetCapture?: React.FormEventHandler<HTMLElement>;
|
|
254
|
+
onSubmit?: React.FormEventHandler<HTMLElement>;
|
|
255
|
+
onSubmitCapture?: React.FormEventHandler<HTMLElement>;
|
|
256
|
+
onInvalid?: React.FormEventHandler<HTMLElement>;
|
|
257
|
+
onInvalidCapture?: React.FormEventHandler<HTMLElement>;
|
|
258
|
+
onLoad?: React.ReactEventHandler<HTMLElement>;
|
|
259
|
+
onLoadCapture?: React.ReactEventHandler<HTMLElement>;
|
|
260
|
+
onError?: React.ReactEventHandler<HTMLElement>;
|
|
261
|
+
onErrorCapture?: React.ReactEventHandler<HTMLElement>;
|
|
262
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
263
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLElement>;
|
|
264
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
|
|
265
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLElement>;
|
|
266
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLElement>;
|
|
267
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLElement>;
|
|
268
|
+
onAbort?: React.ReactEventHandler<HTMLElement>;
|
|
269
|
+
onAbortCapture?: React.ReactEventHandler<HTMLElement>;
|
|
270
|
+
onCanPlay?: React.ReactEventHandler<HTMLElement>;
|
|
271
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLElement>;
|
|
272
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLElement>;
|
|
273
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLElement>;
|
|
274
|
+
onDurationChange?: React.ReactEventHandler<HTMLElement>;
|
|
275
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLElement>;
|
|
276
|
+
onEmptied?: React.ReactEventHandler<HTMLElement>;
|
|
277
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLElement>;
|
|
278
|
+
onEncrypted?: React.ReactEventHandler<HTMLElement>;
|
|
279
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLElement>;
|
|
280
|
+
onEnded?: React.ReactEventHandler<HTMLElement>;
|
|
281
|
+
onEndedCapture?: React.ReactEventHandler<HTMLElement>;
|
|
282
|
+
onLoadedData?: React.ReactEventHandler<HTMLElement>;
|
|
283
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLElement>;
|
|
284
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLElement>;
|
|
285
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLElement>;
|
|
286
|
+
onLoadStart?: React.ReactEventHandler<HTMLElement>;
|
|
287
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLElement>;
|
|
288
|
+
onPause?: React.ReactEventHandler<HTMLElement>;
|
|
289
|
+
onPauseCapture?: React.ReactEventHandler<HTMLElement>;
|
|
290
|
+
onPlay?: React.ReactEventHandler<HTMLElement>;
|
|
291
|
+
onPlayCapture?: React.ReactEventHandler<HTMLElement>;
|
|
292
|
+
onPlaying?: React.ReactEventHandler<HTMLElement>;
|
|
293
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLElement>;
|
|
294
|
+
onProgress?: React.ReactEventHandler<HTMLElement>;
|
|
295
|
+
onProgressCapture?: React.ReactEventHandler<HTMLElement>;
|
|
296
|
+
onRateChange?: React.ReactEventHandler<HTMLElement>;
|
|
297
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLElement>;
|
|
298
|
+
onSeeked?: React.ReactEventHandler<HTMLElement>;
|
|
299
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLElement>;
|
|
300
|
+
onSeeking?: React.ReactEventHandler<HTMLElement>;
|
|
301
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLElement>;
|
|
302
|
+
onStalled?: React.ReactEventHandler<HTMLElement>;
|
|
303
|
+
onStalledCapture?: React.ReactEventHandler<HTMLElement>;
|
|
304
|
+
onSuspend?: React.ReactEventHandler<HTMLElement>;
|
|
305
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLElement>;
|
|
306
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLElement>;
|
|
307
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLElement>;
|
|
308
|
+
onVolumeChange?: React.ReactEventHandler<HTMLElement>;
|
|
309
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLElement>;
|
|
310
|
+
onWaiting?: React.ReactEventHandler<HTMLElement>;
|
|
311
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLElement>;
|
|
312
|
+
onAuxClick?: React.MouseEventHandler<HTMLElement>;
|
|
313
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLElement>;
|
|
314
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
315
|
+
onClickCapture?: React.MouseEventHandler<HTMLElement>;
|
|
316
|
+
onContextMenu?: React.MouseEventHandler<HTMLElement>;
|
|
317
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLElement>;
|
|
318
|
+
onDoubleClick?: React.MouseEventHandler<HTMLElement>;
|
|
319
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLElement>;
|
|
320
|
+
onDrag?: React.DragEventHandler<HTMLElement>;
|
|
321
|
+
onDragCapture?: React.DragEventHandler<HTMLElement>;
|
|
322
|
+
onDragEnd?: React.DragEventHandler<HTMLElement>;
|
|
323
|
+
onDragEndCapture?: React.DragEventHandler<HTMLElement>;
|
|
324
|
+
onDragEnter?: React.DragEventHandler<HTMLElement>;
|
|
325
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLElement>;
|
|
326
|
+
onDragExit?: React.DragEventHandler<HTMLElement>;
|
|
327
|
+
onDragExitCapture?: React.DragEventHandler<HTMLElement>;
|
|
328
|
+
onDragLeave?: React.DragEventHandler<HTMLElement>;
|
|
329
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLElement>;
|
|
330
|
+
onDragOver?: React.DragEventHandler<HTMLElement>;
|
|
331
|
+
onDragOverCapture?: React.DragEventHandler<HTMLElement>;
|
|
332
|
+
onDragStart?: React.DragEventHandler<HTMLElement>;
|
|
333
|
+
onDragStartCapture?: React.DragEventHandler<HTMLElement>;
|
|
334
|
+
onDrop?: React.DragEventHandler<HTMLElement>;
|
|
335
|
+
onDropCapture?: React.DragEventHandler<HTMLElement>;
|
|
336
|
+
onMouseDown?: React.MouseEventHandler<HTMLElement>;
|
|
337
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLElement>;
|
|
338
|
+
onMouseEnter?: React.MouseEventHandler<HTMLElement>;
|
|
339
|
+
onMouseLeave?: React.MouseEventHandler<HTMLElement>;
|
|
340
|
+
onMouseMove?: React.MouseEventHandler<HTMLElement>;
|
|
341
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLElement>;
|
|
342
|
+
onMouseOut?: React.MouseEventHandler<HTMLElement>;
|
|
343
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLElement>;
|
|
344
|
+
onMouseOver?: React.MouseEventHandler<HTMLElement>;
|
|
345
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLElement>;
|
|
346
|
+
onMouseUp?: React.MouseEventHandler<HTMLElement>;
|
|
347
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLElement>;
|
|
348
|
+
onSelect?: React.ReactEventHandler<HTMLElement>;
|
|
349
|
+
onSelectCapture?: React.ReactEventHandler<HTMLElement>;
|
|
350
|
+
onTouchCancel?: React.TouchEventHandler<HTMLElement>;
|
|
351
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLElement>;
|
|
352
|
+
onTouchEnd?: React.TouchEventHandler<HTMLElement>;
|
|
353
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLElement>;
|
|
354
|
+
onTouchMove?: React.TouchEventHandler<HTMLElement>;
|
|
355
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLElement>;
|
|
356
|
+
onTouchStart?: React.TouchEventHandler<HTMLElement>;
|
|
357
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLElement>;
|
|
358
|
+
onPointerDown?: React.PointerEventHandler<HTMLElement>;
|
|
359
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLElement>;
|
|
360
|
+
onPointerMove?: React.PointerEventHandler<HTMLElement>;
|
|
361
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLElement>;
|
|
362
|
+
onPointerUp?: React.PointerEventHandler<HTMLElement>;
|
|
363
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLElement>;
|
|
364
|
+
onPointerCancel?: React.PointerEventHandler<HTMLElement>;
|
|
365
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLElement>;
|
|
366
|
+
onPointerEnter?: React.PointerEventHandler<HTMLElement>;
|
|
367
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLElement>;
|
|
368
|
+
onPointerLeave?: React.PointerEventHandler<HTMLElement>;
|
|
369
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLElement>;
|
|
370
|
+
onPointerOver?: React.PointerEventHandler<HTMLElement>;
|
|
371
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLElement>;
|
|
372
|
+
onPointerOut?: React.PointerEventHandler<HTMLElement>;
|
|
373
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLElement>;
|
|
374
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLElement>;
|
|
375
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLElement>;
|
|
376
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLElement>;
|
|
377
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLElement>;
|
|
378
|
+
onScroll?: React.UIEventHandler<HTMLElement>;
|
|
379
|
+
onScrollCapture?: React.UIEventHandler<HTMLElement>;
|
|
380
|
+
onWheel?: React.WheelEventHandler<HTMLElement>;
|
|
381
|
+
onWheelCapture?: React.WheelEventHandler<HTMLElement>;
|
|
382
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLElement>;
|
|
383
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLElement>;
|
|
384
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLElement>;
|
|
385
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLElement>;
|
|
386
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLElement>;
|
|
387
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLElement>;
|
|
388
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLElement>;
|
|
389
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLElement>;
|
|
390
390
|
};
|
|
391
391
|
};
|
|
392
392
|
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"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","sources":["packages/@react-aria/focus/src/packages/@react-aria/focus/src/focusSafely.ts","packages/@react-aria/focus/src/packages/@react-aria/focus/src/isElementVisible.ts","packages/@react-aria/focus/src/packages/@react-aria/focus/src/FocusScope.tsx","packages/@react-aria/focus/src/packages/@react-aria/focus/src/useFocusRing.ts","packages/@react-aria/focus/src/packages/@react-aria/focus/src/FocusRing.tsx","packages/@react-aria/focus/src/packages/@react-aria/focus/src/useFocusable.tsx","packages/@react-aria/focus/src/packages/@react-aria/focus/src/index.ts","packages/@react-aria/focus/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './FocusScope';\nexport * from './FocusRing';\nexport * from './useFocusable';\nexport * from './useFocusRing';\nexport * from './focusSafely';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/focus",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/interactions": "^3.
|
|
22
|
-
"@react-aria/utils": "^3.
|
|
23
|
-
"@react-types/shared": "^3.
|
|
21
|
+
"@react-aria/interactions": "^3.8.0",
|
|
22
|
+
"@react-aria/utils": "^3.11.1",
|
|
23
|
+
"@react-types/shared": "^3.11.0",
|
|
24
24
|
"clsx": "^1.1.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "54c2366c4f31bd4bf619126131cd583c12972acc"
|
|
33
33
|
}
|
package/src/FocusScope.tsx
CHANGED
|
@@ -387,15 +387,16 @@ function useAutoFocus(scopeRef: RefObject<HTMLElement[]>, autoFocus: boolean) {
|
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boolean, contain: boolean) {
|
|
390
|
+
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
391
|
+
const nodeToRestoreRef = useRef(typeof document !== 'undefined' ? document.activeElement as HTMLElement : null);
|
|
392
|
+
|
|
390
393
|
// useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.
|
|
391
394
|
useLayoutEffect(() => {
|
|
395
|
+
let nodeToRestore = nodeToRestoreRef.current;
|
|
392
396
|
if (!restoreFocus) {
|
|
393
397
|
return;
|
|
394
398
|
}
|
|
395
399
|
|
|
396
|
-
let scope = scopeRef.current;
|
|
397
|
-
let nodeToRestore = document.activeElement as HTMLElement;
|
|
398
|
-
|
|
399
400
|
// Handle the Tab key so that tabbing out of the scope goes to the next element
|
|
400
401
|
// after the node that had focus when the scope mounted. This is important when
|
|
401
402
|
// using portals for overlays, so that focus goes to the expected element when
|
|
@@ -406,7 +407,7 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
406
407
|
}
|
|
407
408
|
|
|
408
409
|
let focusedElement = document.activeElement as HTMLElement;
|
|
409
|
-
if (!isElementInScope(focusedElement,
|
|
410
|
+
if (!isElementInScope(focusedElement, scopeRef.current)) {
|
|
410
411
|
return;
|
|
411
412
|
}
|
|
412
413
|
|
|
@@ -423,13 +424,13 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
423
424
|
|
|
424
425
|
// If there is no next element, or it is outside the current scope, move focus to the
|
|
425
426
|
// next element after the node to restore to instead.
|
|
426
|
-
if ((!nextElement || !isElementInScope(nextElement,
|
|
427
|
+
if ((!nextElement || !isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {
|
|
427
428
|
walker.currentNode = nodeToRestore;
|
|
428
429
|
|
|
429
430
|
// Skip over elements within the scope, in case the scope immediately follows the node to restore.
|
|
430
431
|
do {
|
|
431
432
|
nextElement = (e.shiftKey ? walker.previousNode() : walker.nextNode()) as HTMLElement;
|
|
432
|
-
} while (isElementInScope(nextElement,
|
|
433
|
+
} while (isElementInScope(nextElement, scopeRef.current));
|
|
433
434
|
|
|
434
435
|
e.preventDefault();
|
|
435
436
|
e.stopPropagation();
|
|
@@ -457,7 +458,7 @@ function useRestoreFocus(scopeRef: RefObject<HTMLElement[]>, restoreFocus: boole
|
|
|
457
458
|
document.removeEventListener('keydown', onKeyDown, true);
|
|
458
459
|
}
|
|
459
460
|
|
|
460
|
-
if (restoreFocus && nodeToRestore && isElementInScope(document.activeElement,
|
|
461
|
+
if (restoreFocus && nodeToRestore && isElementInScope(document.activeElement, scopeRef.current)) {
|
|
461
462
|
requestAnimationFrame(() => {
|
|
462
463
|
if (document.body.contains(nodeToRestore)) {
|
|
463
464
|
focusElement(nodeToRestore);
|