Skip to content

fix(radio,toggle,checkbox,select): padded space is clickable in items#28136

Merged
sean-perkins merged 15 commits intomainfrom
sp/FW-4016
Sep 20, 2023
Merged

fix(radio,toggle,checkbox,select): padded space is clickable in items#28136
sean-perkins merged 15 commits intomainfrom
sp/FW-4016

Conversation

@sean-perkins
Copy link
Contributor

@sean-perkins sean-perkins commented Sep 6, 2023

Issue number: Resolves #27169


What is the current behavior?

Clicking the padded space within an ion-item will not pass the click event to the slotted ion-radio, ion-checkbox, ion-select or ion-toggle.

What is the new behavior?

  • The padded space at the start of .item-native and at the end of .item-inner is clickable to activate a control.
    • When the item is clicked, we check if the event is a result of clicking the control or clicking the item's padded space. If the click event is on the control, we don't need to do anything and let the default behavior occur. If the click event is on the padded space, we manually call the .click() method for the interactive element.
  • The cursor pointer displays when hovering over the padded space when a slotted interactive control is present.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Sep 6, 2023
@sean-perkins sean-perkins marked this pull request as ready for review September 8, 2023 20:47
@sean-perkins sean-perkins changed the title fix(radio,toggle,checkbox): padded space is clickable in items fix(radio,toggle,checkbox,select): padded space is clickable in items Sep 18, 2023
Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this out in a lot of different kinds of items and it is looking good. The added e2e tests look good too. Nice job!

@sean-perkins sean-perkins added this pull request to the merge queue Sep 20, 2023
Merged via the queue into main with commit 5b7e422 Sep 20, 2023
@sean-perkins sean-perkins deleted the sp/FW-4016 branch September 20, 2023 03:44
liamdebeasi pushed a commit that referenced this pull request Sep 22, 2023
…#28136)

Issue number: Resolves #27169

---------

<!-- 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. -->

Clicking the padded space within an `ion-item` will not pass the click
event to the slotted `ion-radio`, `ion-checkbox`, `ion-select` or
`ion-toggle`.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- The padded space at the start of `.item-native` and at the end of
`.item-inner` is clickable to activate a control.
- When the item is clicked, we check if the event is a result of
clicking the control or clicking the item's padded space. If the click
event is on the control, we don't need to do anything and let the
default behavior occur. If the click event is on the padded space, we
manually call the `.click()` method for the interactive element.
- The cursor pointer displays when hovering over the padded space when a
slotted interactive control is present.


## 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. -->
liamdebeasi pushed a commit that referenced this pull request Sep 26, 2023
…#28136)

Issue number: Resolves #27169

---------

<!-- 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. -->

Clicking the padded space within an `ion-item` will not pass the click
event to the slotted `ion-radio`, `ion-checkbox`, `ion-select` or
`ion-toggle`.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- The padded space at the start of `.item-native` and at the end of
`.item-inner` is clickable to activate a control.
- When the item is clicked, we check if the event is a result of
clicking the control or clicking the item's padded space. If the click
event is on the control, we don't need to do anything and let the
default behavior occur. If the click event is on the padded space, we
manually call the `.click()` method for the interactive element.
- The cursor pointer displays when hovering over the padded space when a
slotted interactive control is present.


## 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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: form controls in item are not interactive on start/end

3 participants