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 <hi@ionicframework.com> Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
@@ -200,3 +200,10 @@
|
||||
:host(.in-item.range-label-placement-stacked) .native-wrapper {
|
||||
@include margin(null, null, globals.$ion-space-0, null);
|
||||
}
|
||||
|
||||
// Range Focus
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
.range-knob-handle.ion-focused .range-knob {
|
||||
@include globals.focused-state();
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -72,3 +72,27 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('range: states'), () => {
|
||||
test('should render focus state', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-range>
|
||||
<ion-icon name="volume-off" slot="start"></ion-icon>
|
||||
<ion-icon name="volume-high" slot="end"></ion-icon>
|
||||
</ion-range>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const range = page.locator('ion-range');
|
||||
|
||||
const handle = range.locator('.range-knob-handle');
|
||||
|
||||
handle.focus();
|
||||
|
||||
await expect(range).toHaveScreenshot(screenshot(`range-focus`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 2.5 KiB |