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 <hi@ionicframework.com>
This commit is contained in:
Bernardo Cardoso
2024-12-12 08:57:59 +00:00
committed by GitHub
parent 85e12dd624
commit fec23e80cc
5 changed files with 2 additions and 2 deletions

View File

@ -380,8 +380,7 @@ input {
// -------------------------------------------------- // --------------------------------------------------
// Only show the focus ring when the checkbox is focused and not disabled // Only show the focus ring when the checkbox is focused and not disabled
:host(.ion-focused:not(.checkbox-disabled)) .native-wrapper { :host(.ion-focused:not(.checkbox-disabled)) .native-wrapper {
outline: var(--focus-ring-width) globals.$ion-border-style-solid var(--focus-ring-color); @include globals.focused-state(var(--focus-ring-width), globals.$ion-border-style-solid, var(--focus-ring-color));
outline-offset: var(--focus-ring-offset);
} }
// Checkbox: Active // Checkbox: Active

View File

@ -212,6 +212,7 @@ export class Checkbox implements ComponentInterface {
'in-item': hostContext('ion-item', el), 'in-item': hostContext('ion-item', el),
'checkbox-checked': checked, 'checkbox-checked': checked,
'checkbox-disabled': disabled, 'checkbox-disabled': disabled,
'ion-focusable': true,
'checkbox-indeterminate': indeterminate, 'checkbox-indeterminate': indeterminate,
interactive: true, interactive: true,
[`checkbox-justify-${justify}`]: justify !== undefined, [`checkbox-justify-${justify}`]: justify !== undefined,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB