-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Autocomplete: Fix Voiceover not announcing suggestions #54902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
766855b
3c82605
700bb1c
a6b45ab
98bbc1f
b43d95e
6372f1c
96464c6
7ecf361
7972225
7681b88
1e24a70
facbe98
8e7ba56
307b78e
98a845b
6e91679
fe36a90
607c455
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ export type KeyedOption = { | |
| key: string; | ||
| value: any; | ||
| label: OptionLabel; | ||
| textLabel: string; | ||
|
||
| keywords: Array< string >; | ||
| isDisabled: boolean; | ||
| }; | ||
|
|
@@ -68,6 +69,11 @@ export type WPCompleter< TCompleterOption = any > = { | |
| * string or a mixed array of strings, elements, and components. | ||
| */ | ||
| getOptionLabel: ( option: TCompleterOption ) => OptionLabel; | ||
| /** | ||
| * A function that returns the text label for a given option. A text label may be a | ||
| * string only. | ||
| */ | ||
| getOptionTextLabel: ( option: TCompleterOption ) => string; | ||
| /** | ||
| * A function that takes a Range before and a Range after the autocomplete | ||
| * trigger and query text and returns a boolean indicating whether the | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright 2020 Adobe. All rights reserved. | ||
| * This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. You may obtain a copy | ||
| * of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software distributed under | ||
| * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| * OF ANY KIND, either express or implied. See the License for the specific language | ||
| * governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| function testPlatform( re: RegExp ) { | ||
| return typeof window !== 'undefined' && window.navigator !== null | ||
| ? re.test( | ||
| // eslint-disable-next-line dot-notation | ||
| window.navigator[ 'userAgentData' ]?.platform || | ||
| window.navigator.platform | ||
| ) | ||
| : false; | ||
| } | ||
|
|
||
| export function isMac() { | ||
| return testPlatform( /^Mac/i ); | ||
| } | ||
|
|
||
| export function isIPhone() { | ||
| return testPlatform( /^iPhone/i ); | ||
| } | ||
|
|
||
| export function isIPad() { | ||
| return ( | ||
| testPlatform( /^iPad/i ) || | ||
| // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support. | ||
| ( isMac() && navigator.maxTouchPoints > 1 ) | ||
| ); | ||
| } | ||
|
|
||
| export function isIOS() { | ||
| return isIPhone() || isIPad(); | ||
| } | ||
|
|
||
| export function isAppleDevice() { | ||
| return isMac() || isIOS(); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.