-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(textarea): convert to a form associated shadow component #30785
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
Open
brandyscarney
wants to merge
31
commits into
next
Choose a base branch
from
FW-6912-textarea
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,171
−237
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
54a5e4e
refactor(textarea): convert to a form associated shadow component
brandyscarney 8417741
style: lint
brandyscarney 59b2423
chore: build
brandyscarney 08a90a2
test(textarea): query the shadowRoot in tests
brandyscarney f7e8146
test(angular): add textarea to lazy forms test
brandyscarney 6c7d3fb
test(vue): query textarea by shadow and add validation tests
brandyscarney 1fd0f26
test(react): query textarea by shadow and add validation tests
brandyscarney 3bf9289
test(frameworks): input-otp doesn't support required
brandyscarney 27c18c2
test(react): blur focused element instead of targeting textarea
brandyscarney cd58d35
feat(textarea): expose shadow parts
brandyscarney 391d2f6
test(textarea): add tests for form validation and customizing with parts
brandyscarney a401ba2
test(textarea): fix customizing bottom content css
brandyscarney cab5efa
fix(textarea): update styles due to shadow encapsulation
brandyscarney 4ec7a7f
fix(textarea): update styles due to shadow encapsulation
brandyscarney 0e4dee8
fix(textarea): update element internals on load, value change, disabl…
brandyscarney 3c5a152
fix(textarea): add a check for ElementInternals setFormValue for tests
brandyscarney 0db5da6
Merge branch 'next' into FW-6912-textarea
brandyscarney 7f25e7b
test(popover): add popover examples with inputs and buttons
brandyscarney 5fe0c00
chore(): add updated snapshots
brandyscarney f39a1e3
test(popover): update to grab the textarea in shadow root
brandyscarney ec80920
test(popover): add tests for keyboard interactions on inputs and focu…
brandyscarney a2a584f
fix(utils): fix focus behavior for textareas and buttons in popovers
brandyscarney 903b799
fix(overlays): override tab navigation to skip over host elements
brandyscarney 91a2f74
docs(breaking): add textarea conversion
brandyscarney 4480c7a
Merge branch 'next' into FW-6912-textarea
brandyscarney efef5a1
docs(breaking): move radio group to the right place
brandyscarney 823943d
test(textarea): use shadow part for styling native werapper
brandyscarney 3e724c5
fix(textarea): add box-sizing to fix label border shift
brandyscarney 34e104c
Merge branch 'next' into FW-6912-textarea
brandyscarney bb45463
chore(): add updated snapshots
brandyscarney ab96071
Merge branch 'next' into FW-6912-textarea
brandyscarney 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,7 +209,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => | |
| test('should not override keyboard interactions for textarea elements', async ({ page, browserName }) => { | ||
| const tabKey = browserName === 'webkit' ? 'Alt+Tab' : 'Tab'; | ||
| const popover = page.locator('ion-popover'); | ||
| const innerNativeTextarea = page.locator('ion-textarea textarea').nth(0); | ||
| const innerNativeTextarea = page.locator('ion-textarea').locator('textarea').nth(0); | ||
| const vanillaTextarea = page.locator('ion-textarea + textarea'); | ||
|
|
||
| await popoverFixture.open('#popover-with-textarea'); | ||
|
|
@@ -220,44 +220,102 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => | |
| */ | ||
| await expect(popover).toBeFocused(); | ||
|
|
||
| // Tab should focus the native textarea inside ion-textarea | ||
| await page.keyboard.press(tabKey); | ||
|
|
||
| // for Firefox, ion-textarea is focused first | ||
| // need to tab again to get to native input | ||
| if (browserName === 'firefox') { | ||
| await page.keyboard.press(tabKey); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated the focus behavior to remove the requirement to double tab to get to the native textarea in Firefox. |
||
| } | ||
|
|
||
| await expect(innerNativeTextarea).toBeFocused(); | ||
|
|
||
| // Arrow keys should work on the ion-textarea | ||
| await page.keyboard.press('ArrowDown'); | ||
|
|
||
| await expect(innerNativeTextarea).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('ArrowUp'); | ||
|
|
||
| await expect(innerNativeTextarea).toBeFocused(); | ||
|
|
||
| // Tab again should focus the vanilla textarea | ||
| await page.keyboard.press(tabKey); | ||
| // Checking within HTML textarea | ||
|
|
||
| await expect(vanillaTextarea).toBeFocused(); | ||
|
|
||
| // Arrow keys should work on the vanilla textarea | ||
| await page.keyboard.press('ArrowDown'); | ||
|
|
||
| await expect(vanillaTextarea).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('ArrowUp'); | ||
|
|
||
| await expect(vanillaTextarea).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('Home'); | ||
| await expect(vanillaTextarea).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('End'); | ||
| await expect(vanillaTextarea).toBeFocused(); | ||
| }); | ||
|
|
||
| test('should not override keyboard interactions for input elements', async ({ page, browserName }) => { | ||
| const tabKey = browserName === 'webkit' ? 'Alt+Tab' : 'Tab'; | ||
| const popover = page.locator('ion-popover'); | ||
| const innerNativeInput = page.locator('ion-input input').nth(0); | ||
| const vanillaInput = page.locator('ion-input + input'); | ||
|
|
||
| await popoverFixture.open('#popover-with-input'); | ||
|
|
||
| /** | ||
| * Focusing happens async inside of popover so we need | ||
| * to wait for the requestAnimationFrame to fire. | ||
| */ | ||
| await expect(popover).toBeFocused(); | ||
|
|
||
| // Tab should focus the native input inside ion-input | ||
| await page.keyboard.press(tabKey); | ||
|
|
||
| await expect(innerNativeInput).toBeFocused(); | ||
|
|
||
| // Arrow keys should work on the ion-input | ||
| await page.keyboard.press('ArrowDown'); | ||
| await expect(innerNativeInput).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('ArrowUp'); | ||
| await expect(innerNativeInput).toBeFocused(); | ||
|
|
||
| // Tab again should focus the vanilla input | ||
| await page.keyboard.press(tabKey); | ||
| await expect(vanillaInput).toBeFocused(); | ||
|
|
||
| // Arrow keys should work on the vanilla input | ||
| await page.keyboard.press('ArrowDown'); | ||
| await expect(vanillaInput).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('ArrowUp'); | ||
| await expect(vanillaInput).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('Home'); | ||
| await expect(vanillaInput).toBeFocused(); | ||
|
|
||
| await page.keyboard.press('End'); | ||
| await expect(vanillaInput).toBeFocused(); | ||
| }); | ||
|
|
||
| await expect(vanillaTextarea).toBeFocused(); | ||
| test('should move focus between buttons', async ({ page, browserName }) => { | ||
| const tabKey = browserName === 'webkit' ? 'Alt+Tab' : 'Tab'; | ||
| const buttons = page.locator('ion-popover button'); | ||
|
|
||
| await popoverFixture.open('#popover-with-buttons'); | ||
|
|
||
| await page.keyboard.press(tabKey); | ||
| await expect(buttons.nth(0)).toBeFocused(); | ||
|
|
||
| await page.keyboard.press(tabKey); | ||
| await expect(buttons.nth(1)).toBeFocused(); | ||
|
|
||
| await page.keyboard.press(tabKey); | ||
| await expect(buttons.nth(0)).toBeFocused(); | ||
|
|
||
| await page.keyboard.press(`Shift+${tabKey}`); | ||
| await expect(buttons.nth(1)).toBeFocused(); | ||
|
|
||
| await page.keyboard.press(`Shift+${tabKey}`); | ||
| await expect(buttons.nth(0)).toBeFocused(); | ||
|
|
||
| await page.keyboard.press(`Shift+${tabKey}`); | ||
| await expect(buttons.nth(1)).toBeFocused(); | ||
| }); | ||
| }); | ||
| }); | ||
Binary file modified
BIN
+4.38 KB
(120%)
...er.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+5.56 KB
(120%)
...r.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+6.62 KB
(130%)
...er.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+4.38 KB
(120%)
...er.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+5.64 KB
(120%)
...r.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+6.62 KB
(130%)
...er.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+4.51 KB
(120%)
...ver.e2e.ts-snapshots/popover-basic-basic-popover-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
+4.32 KB
(120%)
...er.e2e.ts-snapshots/popover-basic-basic-popover-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
+5.95 KB
(130%)
...ver.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+4.54 KB
(120%)
...ver.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+4.38 KB
(120%)
...er.e2e.ts-snapshots/popover-basic-basic-popover-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 modified
BIN
+5.95 KB
(130%)
...ver.e2e.ts-snapshots/popover-basic-basic-popover-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.
Binary file modified
BIN
+4.54 KB
(110%)
...ts-snapshots/popover-basic-custom-class-popover-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 modified
BIN
+5.9 KB
(110%)
...s-snapshots/popover-basic-custom-class-popover-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 modified
BIN
+6.7 KB
(120%)
...ts-snapshots/popover-basic-custom-class-popover-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 modified
BIN
+4.47 KB
(120%)
....ts-snapshots/popover-basic-custom-class-popover-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
+5.44 KB
(110%)
...ts-snapshots/popover-basic-custom-class-popover-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
+6.23 KB
(120%)
....ts-snapshots/popover-basic-custom-class-popover-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 modified
BIN
-793 Bytes
(98%)
...r.e2e.ts-snapshots/popover-basic-header-popover-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 modified
BIN
+82 Bytes
(100%)
....e2e.ts-snapshots/popover-basic-header-popover-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 modified
BIN
+967 Bytes
(100%)
...r.e2e.ts-snapshots/popover-basic-header-popover-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 modified
BIN
-473 Bytes
(99%)
...er.e2e.ts-snapshots/popover-basic-header-popover-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
+643 Bytes
(100%)
...r.e2e.ts-snapshots/popover-basic-header-popover-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
+791 Bytes
(100%)
...er.e2e.ts-snapshots/popover-basic-header-popover-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 modified
BIN
+484 Bytes
(100%)
...2e.ts-snapshots/popover-basic-long-list-popover-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 modified
BIN
+327 Bytes
(100%)
...e.ts-snapshots/popover-basic-long-list-popover-ios-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+675 Bytes
(100%)
...2e.ts-snapshots/popover-basic-long-list-popover-ios-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file modified
BIN
+660 Bytes
(100%)
...e2e.ts-snapshots/popover-basic-long-list-popover-md-ltr-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+325 Bytes
(100%)
...2e.ts-snapshots/popover-basic-long-list-popover-md-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+668 Bytes
(100%)
...e2e.ts-snapshots/popover-basic-long-list-popover-md-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file modified
BIN
+243 Bytes
(100%)
...pshots/popover-basic-translucent-header-popover-ios-ltr-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+183 Bytes
(100%)
...shots/popover-basic-translucent-header-popover-ios-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+994 Bytes
(100%)
...pshots/popover-basic-translucent-header-popover-ios-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file modified
BIN
+3.01 KB
(110%)
....ts-snapshots/popover-basic-translucent-popover-ios-ltr-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file modified
BIN
+5.77 KB
(110%)
...ts-snapshots/popover-basic-translucent-popover-ios-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file modified
BIN
+7.1 KB
(120%)
....ts-snapshots/popover-basic-translucent-popover-ios-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Radio Group was in the wrong place in this file I just moved it down under Grid.