Skip to content

Commit

Permalink
refactor(menu, overlays): update comments and add if
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC committed Nov 22, 2024
1 parent c10776b commit 9d90e1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,9 @@ export class Menu implements ComponentInterface, MenuI {
* transition to prevent this. Once the transition is complete, the menu
* is shown again.
*/
this.el.removeAttribute('aria-hidden');
if (isPlatform('android')) {
this.el.removeAttribute('aria-hidden');
}

// emit open event
this.ionDidOpen.emit();
Expand Down
11 changes: 6 additions & 5 deletions core/src/utils/overlays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,12 @@ export const createTriggerController = () => {
* like TalkBack do not announce or interact with the content until the
* animation is complete, avoiding confusion for users.
*
* If the overlay is being presented, it prevents focus rings from appearing
* in incorrect positions due to the transition (specifically `transform`
* styles), ensuring that when aria-hidden is removed, the focus rings are
* correctly displayed in the final location of the elements. This only
* applies to Android devices.
* When the overlay is presented on an Android device, TalkBack's focus rings
* may appear in the wrong position due to the transition (specifically
* `transform` styles). This occurs because the focus rings are initially
* displayed at the starting position of the elements before the transition
* begins. This workaround ensures the focus rings do not appear in the
* incorrect location.
*
* If this solution is applied to iOS devices, then it leads to a bug where
* the overlays cannot be accessed by screen readers. This is due to
Expand Down

0 comments on commit 9d90e1c

Please sign in to comment.