-
Notifications
You must be signed in to change notification settings - Fork 13.5k
feat(datetime-button): add support for custom, disabled, and accessible buttons #25622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f15a41d
feat(datetime-button): add base component
liamdebeasi be5ef5a
chore(): lint
liamdebeasi c2a3669
chore(): prettier
liamdebeasi e931d28
feat(datetime-button): add base styles and examples
liamdebeasi 059f118
feat(datetime-button): add base functionality
liamdebeasi 98879f0
feat(datetime-button): add support for active states
liamdebeasi c6e594b
feat(datetime-button): ensure overlays are sized correctly
liamdebeasi 4aa1bec
chore(): remove stubs
liamdebeasi a802aa5
Revert "feat(datetime-button): ensure overlays are sized correctly"
liamdebeasi a4ac7a2
test(datetime-button): add basic rendering tests
liamdebeasi bf1faeb
chore(): lint
liamdebeasi e4e9958
chore(): lint
liamdebeasi ae63db5
test(): fix test
liamdebeasi cc0a1d4
feat(datetime-button): improve button support
liamdebeasi e817a2d
docs(): add slot documentation
liamdebeasi 2adf417
Merge remote-tracking branch 'origin/FW-546' into 546-base
liamdebeasi cd7642b
Merge remote-tracking branch 'origin/546-base' into 546-styles
liamdebeasi 31289c8
Merge remote-tracking branch 'origin/546-styles' into 546-text
liamdebeasi c1766ca
chore(): sync
liamdebeasi 0a932ea
chore(): sync with FW-546
liamdebeasi 34f9f68
chore(): sync with FW-546
liamdebeasi 8272747
test(): fix tests from bad merge
liamdebeasi 463421c
test(datetime-button): add disabled visual test
liamdebeasi 58899c2
chore(): add updated snapshots
Ionitron 2174cd3
test(datetime-button): move skip to non-screenshot test
liamdebeasi d6aaef4
test(datetime-button): add default value
liamdebeasi 8b5206d
chore(): add missing quote
liamdebeasi afee026
chore(): add updated snapshots
Ionitron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
core/src/components/datetime-button/test/disabled/datetime-button.e2e.ts
This file contains hidden or 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,30 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test/playwright'; | ||
|
||
test.describe('datetime-button: disabled buttons', () => { | ||
test('buttons should not be enabled when component is disabled', async ({ page }, testInfo) => { | ||
test.skip(testInfo.project.metadata.rtl === 'rtl', 'No layout tests'); | ||
test.skip(testInfo.project.metadata.mode === 'ios', 'No mode-specific logic'); | ||
|
||
await page.setContent(` | ||
<ion-datetime-button datetime="datetime" disabled="true"></ion-datetime-button> | ||
<ion-datetime id="datetime" presentation="date-time"></ion-datetime> | ||
`); | ||
await page.waitForSelector('.datetime-ready'); | ||
|
||
await expect(page.locator('#date-button')).toBeDisabled(); | ||
await expect(page.locator('#time-button')).toBeDisabled(); | ||
}); | ||
test('buttons should visually be disabled', async ({ page }) => { | ||
await page.setContent(` | ||
<ion-datetime-button datetime="datetime" disabled="true"></ion-datetime-button> | ||
<ion-datetime id="datetime" presentation="date-time" value="2022-01-01T16:30:00"></ion-datetime> | ||
`); | ||
await page.waitForSelector('.datetime-ready'); | ||
|
||
const datetimeButton = page.locator('ion-datetime-button'); | ||
expect(await datetimeButton.screenshot()).toMatchSnapshot( | ||
`datetime-button-disabled-${page.getSnapshotSettings()}.png` | ||
); | ||
}); | ||
}); |
Binary file added
BIN
+9.17 KB
...utton.e2e.ts-snapshots/datetime-button-disabled-ios-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
+3.78 KB
...tton.e2e.ts-snapshots/datetime-button-disabled-ios-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
+8.71 KB
...utton.e2e.ts-snapshots/datetime-button-disabled-ios-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.
Binary file added
BIN
+9.21 KB
...utton.e2e.ts-snapshots/datetime-button-disabled-ios-rtl-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
+3.81 KB
...tton.e2e.ts-snapshots/datetime-button-disabled-ios-rtl-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
+8.71 KB
...utton.e2e.ts-snapshots/datetime-button-disabled-ios-rtl-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.
Binary file added
BIN
+9.65 KB
...button.e2e.ts-snapshots/datetime-button-disabled-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
+3.44 KB
...utton.e2e.ts-snapshots/datetime-button-disabled-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
+7.58 KB
...button.e2e.ts-snapshots/datetime-button-disabled-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.
Binary file added
BIN
+9.43 KB
...button.e2e.ts-snapshots/datetime-button-disabled-md-rtl-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
+3.13 KB
...utton.e2e.ts-snapshots/datetime-button-disabled-md-rtl-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
+8.25 KB
...button.e2e.ts-snapshots/datetime-button-disabled-md-rtl-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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.