Repository navigation
feat(range): rtl support - #12004
feat(range): rtl support#12004AmitMY wants to merge 3 commits into
Conversation
|
|
||
| /** @internal */ | ||
| _calcRatio(current: PointerCoordinates, rect: ClientRect): number { | ||
| let ratio = clamp(0, (current.x - rect.left) / (rect.width), 1); |
There was a problem hiding this comment.
You said in the PR, we used a all-css approach, am I missing something?
There was a problem hiding this comment.
Typescript only has one "change", which is to flip the X coordinate, (but easier is to flip the ratio which is already normalised)
Instead of changing the entire component logic for RTL.
But this works on the fly. the _calcRatio method I added reduced a code clone that calculated ratio in 2 places.
|
Hello and thank you for contributing to Ionic! We have been working on porting all of the Ionic components to web components and have recently updated |
Short description of what this resolves:
Ranges or RTL
Changes proposed in this pull request:
I took a very odd approach. instead of logically fitting it to RTL (which will be a pain to always change style properties on the fly, and will have no real time support), I decided to make all the logic in CSS.
RTL range bar is the same as LTR, but with
scaleX(-1). Typescript only has one "change", which is to flip the X coordinate, (but easier is to flip theratiowhich is already normalised)I know this is bordering stupidity, but I think this might be to stupid, so it just loops around to be genius.
Ionic Version: 3.x
closes: #12151