Skip to content

Commit 641f250

Browse files
committed
docs(select): update comment
1 parent 3a5d486 commit 641f250

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

core/src/components/select/select.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,15 @@ export class Select implements ComponentInterface {
321321
* However, the announcement can be spotty
322322
* when using a non-native form control
323323
* and `forceUpdate()`.
324-
* This is due to `forceUpdate()` not being
325-
* high priority enough to guarantee
326-
* the DOM is updated before the screen reader
327-
* announces the attribute change.
328-
* By using a promise, it makes sure to
329-
* announce the change before the next frame
330-
* since promises are high priority.
324+
* This is due to `forceUpdate()` internally
325+
* rescheduling the DOM update to a lower
326+
* priority queue regardless if it's called
327+
* inside a Promise or not, thus causing
328+
* the screen reader to potentially miss the
329+
* change.
330+
* By using a State variable inside a Promise,
331+
* it guarantees a re-render immediately at
332+
* a higher priority.
331333
*/
332334
Promise.resolve().then(() => {
333335
this.hintTextID = this.getHintTextID();

0 commit comments

Comments
 (0)