Skip to content

feat(range): ionChange will only emit from user committed changes - #26089

Merged
sean-perkins merged 21 commits into
feature-7.0from
FW-2034
Oct 24, 2022
Merged

sean-perkins merged 21 commits into
feature-7.0from
FW-2034

Conversation

@sean-perkins

@sean-perkins sean-perkins commented Oct 7, 2022 •

Copy link
Copy Markdown
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

ion-range will emit an ionChange event when the value is programmatically assigned.

Issue URL: #21101

What is the new behavior?

  • ion-range will only emit ionChange from user interaction, such as dragging and releasing the knob or using keyboard navigation to change the value.
  • The debounce property defaults to undefined instead of 0.
  • Isolated form control test for individual component vs. whole suite (simplifies tests moving forward and avoids conflicts with cypress interacting with element).
  • Introduced ionInput event on ion-range, that is emitted whenever the internal value changes (such as dragging the range knob).

Does this introduce a breaking change?

  • Yes
  • No
  • ionChange is no longer emitted when the value of ion-range is modified externally. ionChange is only emitted from user committed changes, such as dragging and releasing the range knob or selecting a new value with the keyboard arrows.

    • If your application requires immediate feedback based on the user actively dragging the range knob, consider migrating your event listeners to using ionInput instead.
  • The debounce property's value value has changed from 0 to undefined. If debounce is undefined, the ionInput event will fire immediately.

Other information

@github-actions github-actions Bot added package: angular @ionic/angular package package: core @ionic/core package labels Oct 7, 2022
Comment thread core/src/components/range/range.tsx Resolved
@sean-perkins
sean-perkins marked this pull request as ready for review October 7, 2022 20:45
@sean-perkins
sean-perkins requested a review from a team as a code owner October 7, 2022 20:45
@averyrousseau

Copy link
Copy Markdown
Contributor

I'm seeing Maximum call stack size exceeded errors when dragging either knob on a dual knobs range, specifically the one in the basic test. (Doesn't happen in the feature-7.0 branch.)

@liamdebeasi liamdebeasi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also ditto what Amanda said re: dual knobs

Comment thread core/src/components/range/range.tsx Resolved
Comment thread core/src/components/range/range.tsx Resolved
@github-actions github-actions Bot added the package: vue @ionic/vue package label Oct 11, 2022
Comment thread core/src/components/range/range.tsx Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants