fix(item): ensure button focus state on property change - #28892
Conversation
sean-perkins
left a comment
There was a problem hiding this comment.
Great work! I am able to verify locally that the ion-button is able to receive focus and appropriately styling when the button property is dynamically set.
I am going to reset core/src/components/item/test/buttons/index.html back to origin/main. We have existing screenshots that use the entire page template for the screenshot: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/item/test/buttons/item.e2e.ts#L13 and adding new elements will cause "visual regressions" to the existing screenshot references. Since we are not adding new E2E tests, we don't necessarily need this diff beyond local testing.
|
|
||
| import { Item } from '../item'; | ||
|
|
||
| it('should change focusable option after switching button option status', async () => { |
There was a problem hiding this comment.
I will refactor this when I address the parent comment, for tests we try to nest them under a describe block for the component name.
For example:
describe('item', () => {
/* existing test */
});It helps when reviewing the logs locally or in CI to know exactly which component the spec test is responsible for.
Issue number: resolves #28525
What is the current behavior?
When navigated via tab-key, the ion-item is not highlighted correctly after switching from button=false to button=true.
What is the new behavior?
Now, when dynamically changing the the
buttonoption toTrue, there's a@watchcallback that will make sure the internalisFocusable@statewill be updated.ion-item, a new files was created -item.spec.tsxDoes this introduce a breaking change?
Other information
New behavior in runtime: