Skip to content

feat(range): rtl support - #12004

Closed
AmitMY wants to merge 3 commits into
ionic-team:masterfrom
AmitMY:range-rtl
Closed

AmitMY wants to merge 3 commits into
ionic-team:masterfrom
AmitMY:range-rtl

Conversation

@AmitMY

@AmitMY AmitMY commented Jun 10, 2017 •

Copy link
Copy Markdown
Contributor

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 the ratio which 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


/** @internal */
_calcRatio(current: PointerCoordinates, rect: ClientRect): number {
let ratio = clamp(0, (current.x - rect.left) / (rect.width), 1);

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.

You said in the PR, we used a all-css approach, am I missing something?

@AmitMY AmitMY Jun 12, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@Ionitron

Copy link
Copy Markdown
Collaborator

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 master to reflect this. This significant change has caused this pull request to break. While we really appreciate the time and effort you put into creating this, we are not able to merge it because of the newly introduced conflicts. We are extremely sorry about this. We will not be merging any more features in to v3. If this is a feature and you have the time, please resubmit this PR against the master branch. If this is a critical security issue in v3, we would greatly appreciate it if you would resubmit the PR against the new v3 branch. Thanks so much for your time!

@Ionitron Ionitron closed this Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants