Skip to content

Commit fec23e8

Browse files
BenOsodracIonitron
andauthored
feat(checkbox): add checkbox missing focus on tab (#30075)
Issue number: internal --------- <!-- 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 new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Added ion-focusable class to ion-checkbox - Replaced ionic focus styles for focus mixin ## 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/docs/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. --> - [Ionic states sample](https://ionic-framework-my9hzgra2-ionic1.vercel.app/src/components/checkbox/test/states?ionic:theme=ionic) --------- Co-authored-by: ionitron <[email protected]>
1 parent 85e12dd commit fec23e8

File tree

5 files changed

+2
-2
lines changed

5 files changed

+2
-2
lines changed

core/src/components/checkbox/checkbox.ionic.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,7 @@ input {
380380
// --------------------------------------------------
381381
// Only show the focus ring when the checkbox is focused and not disabled
382382
:host(.ion-focused:not(.checkbox-disabled)) .native-wrapper {
383-
outline: var(--focus-ring-width) globals.$ion-border-style-solid var(--focus-ring-color);
384-
outline-offset: var(--focus-ring-offset);
383+
@include globals.focused-state(var(--focus-ring-width), globals.$ion-border-style-solid, var(--focus-ring-color));
385384
}
386385

387386
// Checkbox: Active

core/src/components/checkbox/checkbox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ export class Checkbox implements ComponentInterface {
212212
'in-item': hostContext('ion-item', el),
213213
'checkbox-checked': checked,
214214
'checkbox-disabled': disabled,
215+
'ion-focusable': true,
215216
'checkbox-indeterminate': indeterminate,
216217
interactive: true,
217218
[`checkbox-justify-${justify}`]: justify !== undefined,
72 Bytes
Loading
65 Bytes
Loading
83 Bytes
Loading

0 commit comments

Comments
 (0)