8000 fix(input): slotted buttons are clickable (#28772) · ionic-team/ionic-framework@4ccc150 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 4ccc150

Browse files
authored
fix(input): slotted buttons are clickable (#28772)
Issue number: resolves #28762 --------- <!-- 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. --> Focused inputs have `pointer-events: none`. This code was added in e27452b to address #5536. However, this causes slotted buttons to not be clickable when the input is focused because pointer events have been removed. This also causes the input to blur whenever you tap the label text. This behavior only exists on `ion-input`. Textarea is not affected. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> This code was added several years ago for the (now) legacy syntax. I don't have full confidence that this won't break the legacy input because there's not a lot of context around why specifically this code was added. As a result, I scoped these styles only to the legacy input. - Slotted buttons can now be clicked when the input is focused. - Tapping the label when an input is focused keeps the input focused. ## 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/.github/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. --> **Testing:** 1. I manually verified that scroll assist still works with the modern input. 2. I manually verified that the input remains focused after tapping the label. Dev build: `7.6.3-dev.11704229014.12cdc767`
1 parent fbada1d commit 4ccc150

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

core/src/components/input/input.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,16 @@
259259

260260
// Input Has focus
261261
// --------------------------------------------------
262-
// When the input has focus, then the input cover should be hidden
263262

264-
:host(.has-focus) {
263+
// TODO FW-2764 Remove this
264+
:host(.has-focus.legacy-input) {
265265
pointer-events: none;
266266
}
267267

268-
:host(.has-focus) input,
269-
:host(.has-focus) a,
270-
:host(.has-focus) button {
268+
// TODO FW-2764 Remove this
269+
:host(.has-focus.legacy-input) input,
270+
:host(.has-focus.legacy-input) a,
271+
:host(.has-focus.legacy-input) button {
271272
pointer-events: auto;
272273
}
273274

0 commit comments

Comments
 (0)
0