-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat: add experimental transition focus manager #29400
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
test('should focus heading', async ({ page }) => { | ||
const goToPageOneButton = page.locator('page-root ion-button.page-one'); | ||
const nav = page.locator('ion-nav'); | ||
const ionNavDidChange = await (nav as any).spyOnEvent('ionNavDidChange'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to figure out why spyOnEvent
does not exist on the type interface for our custom Locator, but the method does indeed exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to cast:
import type { E2ELocator } from '@utils/test/playwright';
...
const nav = page.locator('ion-nav') as E2ELocator;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, worked fine on iOS and Android physical devices.
Issue number: resolves #23650
What is the current behavior?
In traditional native applications, navigation will inform screen readers that the view has changed. This allows screen readers to focus the correct view. In a single page app on the web, this same concept does not exist. As a result, transitioning from Page A to Page B results in screen reader focus remaining on Page A. This means that users who rely on screen readers are not informed of view changes.
Currently, developers are responsible for implementing this on their own.
What is the new behavior?
There is some risk here by managing focus for the application. As a result, this feature is considered experimental and disabled by default. The team should collect feedback based on usage and enable it by default when they feel this feature is stable enough.
Does this introduce a breaking change?
Other information
tsconfig.json
change, reviewers should restart the Stencil dev server when checking out these changes locally.Reviewers: Please test both of the test template files on physical iOS and Android device with VoiceOver and TalkBack enabled, respectively.
Docs Link: ionic-team/ionic-docs#3627