Repository navigation
Conversation
…eEnd event details
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 of 2 tasks
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #25216
What is the current behavior?
Currently,
ionKnobMoveStartandionKnobMoveEndonly includevalue, so a range withdualKnobshas no way to tell you which knob the user moved.What is the new behavior?
Both events now include
knobandpositionin their detail. Theknobfield is'A'or'B'and stays the same if the knobs cross. Thepositionfield is'lower'or'upper', based on the value that knob holds before the move on start and after it on end, so dragging knob A past knob B reportslowerand thenupper. A single knob range always reports'A'and'lower'.To report the knob on
ionKnobMoveStart, we now pick it inonStart. Before this, it was picked on the firstonMove, after the start event had already fired.Does this introduce a breaking change?
Other information
The field names match range's existing shadow parts, where
knob-aandknob-bstick with a knob andknob-lowerandknob-upperswap when the knobs cross. We expose both because the issue asks for different behavior per knob, and some apps will care about the knob while others care about which value it changed.The new types use the
Rangeprefix like the other range types (RangeValue,RangeCustomEvent). There's aRangeKnobNameandRangeKnobPositionfor the field values, plus aRangeKnobMoveStartCustomEventandRangeKnobMoveEndCustomEventper event, the same way we addedReorderMoveCustomEventandRefresherPullEndCustomEvent. The custom event types are exported from core and from the Angular, React and Vue packages.We export them because otherwise
RangeCustomEventis the only typed option, and itsdetailis a union that includesRangeChangeEventDetail, so readingknobneeds a cast:Tapping a range inside an
ion-contentwithscroll-y="false"also no longer turns scrolling back on, since the tap now saves the scroll state before restoring it. This was sort of an unexpected bug fix that came along for the ride (resolves #30952)Docs PR
ionic-team/ionic-docs#4849