-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spinner): allow resizing of dots, bubbles, and circles (#27424)
Issue number: Resolves #18115 --------- <!-- 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. --> Resizing the `ion-spinner` by setting the width & height using CSS works for most spinner variants, but not for `dots`, `bubbles`, and `circles`. The spacing between the circles on these spinner variants is not scaling with the spinner. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - `ion-spinner` may now be resized by setting the width & height using CSS for all variants. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> ### Before <img width="371" alt="Screenshot 2023-05-08 at 5 17 59 PM" src="https://user-images.githubusercontent.com/14926794/236937361-b8139bb3-192d-4fbf-839c-f9262b7c112a.png"> ### After <img width="373" alt="Screenshot 2023-05-08 at 5 18 45 PM" src="https://user-images.githubusercontent.com/14926794/236937508-9a8fa74e-60c8-47d9-9d56-c287da03a33f.png"> --------- Co-authored-by: ionitron <[email protected]>
- Loading branch information
1 parent
3f07297
commit e5ae45d
Showing
13 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-32.5 KB
...lor/spinner.e2e.ts-snapshots/spinner-color-diff-ios-ltr-Mobile-Chrome-linux.png
Binary file not shown.
Binary file removed
BIN
-34.8 KB
...or/spinner.e2e.ts-snapshots/spinner-color-diff-ios-ltr-Mobile-Firefox-linux.png
Binary file not shown.
Binary file removed
BIN
-29 KB
...lor/spinner.e2e.ts-snapshots/spinner-color-diff-ios-ltr-Mobile-Safari-linux.png
Binary file not shown.
Binary file modified
BIN
-3.16 KB
(90%)
...olor/spinner.e2e.ts-snapshots/spinner-color-diff-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.17 KB
(91%)
...lor/spinner.e2e.ts-snapshots/spinner-color-diff-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.77 KB
(90%)
...olor/spinner.e2e.ts-snapshots/spinner-color-diff-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { expect } from '@playwright/test'; | ||
import { configs, test } from '@utils/test/playwright'; | ||
|
||
/** | ||
* The resize behavior does not vary across directions or modes. | ||
*/ | ||
configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, config }) => { | ||
test.describe(title('spinner: resize'), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.setViewportSize({ width: 320, height: 340 }); | ||
}); | ||
test('should not have visual regressions', async ({ page }) => { | ||
await page.setContent( | ||
` | ||
<style> | ||
ion-spinner { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<ion-spinner name="lines"></ion-spinner> | ||
<ion-spinner name="lines-small"></ion-spinner> | ||
<ion-spinner name="lines-sharp"></ion-spinner> | ||
<ion-spinner name="lines-sharp-small"></ion-spinner> | ||
<ion-spinner name="circular"></ion-spinner> | ||
<ion-spinner name="dots"></ion-spinner> | ||
<ion-spinner name="bubbles"></ion-spinner> | ||
<ion-spinner name="circles"></ion-spinner> | ||
<ion-spinner name="crescent"></ion-spinner> | ||
`, | ||
config | ||
); | ||
|
||
await expect(page).toHaveScreenshot(screenshot(`spinner-resize-diff`)); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+12.5 KB
...ize/spinner.e2e.ts-snapshots/spinner-resize-diff-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.3 KB
...ze/spinner.e2e.ts-snapshots/spinner-resize-diff-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.9 KB
...ize/spinner.e2e.ts-snapshots/spinner-resize-diff-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.