-
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
bug: setting button="true" after load does not make item focusable #28525
Closed
3 tasks done
Labels
Comments
liamdebeasi
changed the title
bug: ion-item not being updated
bug: setting button="true" after load does not make item focusable
Nov 14, 2023
liamdebeasi
added
package: core
@ionic/core package
type: bug
a confirmed bug report
labels
Nov 14, 2023
This was referenced Jan 25, 2024
Merged
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 26, 2024
Issue number: resolves #28525 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> 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? <!-- Please describe the behavior or changes that are being added by this PR. --> Now, when dynamically changing the the `button` option to `True`, there's a `@watch` callback that will make sure the internal `isFocusable` `@state` will be updated. - A new unit test was added to item/test. As there was still any unit test for the `ion-item`, a new files was created - `item.spec.tsx` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> New behavior in runtime: ![focusable](https://github.com/BenOsodrac/ionic-framework/assets/32780808/5c2179cb-c121-4529-92cc-4fb3d764b027) --------- Co-authored-by: Sean Perkins <[email protected]>
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
when navigated via tab-key, the ion-item is not highlighted correctly after switching from
button=false
tobutton=true
.Expected Behavior
ion-item should adjust it's highlighting styles when the button property changes.
the css classes
ion-focusable
andion-focused
are no longer present when the bug appears.my wild guess is that
this.focusable
is initialized once, but never updated:https://github.com/ionic-team/ionic-framework/blob/v7.5.0/core/src/components/item/item.tsx#L265
Steps to Reproduce
It's important to start with
foo = false
as initial value to reproduce the bug.Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 7.1.1
Ionic Framework : @ionic/angular 7.5.0
@angular-devkit/build-angular : 16.2.10
@angular-devkit/schematics : 16.2.1
@angular/cli : 16.2.1
@ionic/angular-toolkit : 9.0.0
Capacitor:
Capacitor CLI : 4.8.1
@capacitor/android : 4.8.1
@capacitor/core : 4.8.1
@capacitor/ios : 4.8.1
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed globally
native-run : 1.7.4
System:
NodeJS : v18.18.2 (C:\Program Files\nodejs\node.exe)
npm : 9.8.1
OS : Windows 10
The text was updated successfully, but these errors were encountered: