Skip to content

Commit 3091390

Browse files
BenOsodracIonitronthetaPC
authored
feat(range): add focus styles to range (#30077)
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. --> - Add focus styles to ion-range when using Ionic theme. - Add new focus test for ionic theme. - Add new snapshots. ## 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. --> - [Range ionic focus](https://ionic-framework-asncg3yot-ionic1.vercel.app/src/components/range/test/states?ionic:theme=ionic) --------- Co-authored-by: ionitron <[email protected]> Co-authored-by: Maria Hutt <[email protected]>
1 parent 8f6f8b4 commit 3091390

8 files changed

+31
-0
lines changed

core/src/components/range/range.ionic.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,10 @@
200200
:host(.in-item.range-label-placement-stacked) .native-wrapper {
201201
@include margin(null, null, globals.$ion-space-0, null);
202202
}
203+
204+
// Range Focus
205+
// ----------------------------------------------------------------
206+
207+
.range-knob-handle.ion-focused .range-knob {
208+
@include globals.focused-state();
209+
}
798 Bytes
Loading
976 Bytes
Loading
828 Bytes
Loading

core/src/components/range/test/states/range.e2e.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,27 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
7272
});
7373
});
7474
});
75+
76+
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
77+
test.describe(title('range: states'), () => {
78+
test('should render focus state', async ({ page }) => {
79+
await page.setContent(
80+
`
81+
<ion-range>
82+
<ion-icon name="volume-off" slot="start"></ion-icon>
83+
<ion-icon name="volume-high" slot="end"></ion-icon>
84+
</ion-range>
85+
`,
86+
config
87+
);
88+
89+
const range = page.locator('ion-range');
90+
91+
const handle = range.locator('.range-knob-handle');
92+
93+
handle.focus();
94+
95+
await expect(range).toHaveScreenshot(screenshot(`range-focus`));
96+
});
97+
});
98+
});
2.41 KB
Loading
3.21 KB
Loading
2.5 KB
Loading

0 commit comments

Comments
 (0)