File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
core/src/components/select Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments