Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add range slider component #154

Merged
merged 7 commits into from
Jul 4, 2018
Merged

Conversation

andrewpye
Copy link
Member

Adds a full implementation of the Polaris range slider component:

polaris-range-slider

@andrewpye andrewpye self-assigned this Jul 3, 2018
@andrewpye andrewpye requested review from vladucu and tomnez July 3, 2018 14:47
@andrewpye
Copy link
Member Author

Copy link
Member

@vladucu vladucu left a comment

Choose a reason for hiding this comment

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

couple of minor questions, but this looks solid to me

* Increment value for range input changes
*
* @property {step}
* @type {Number?}
Copy link
Member

Choose a reason for hiding this comment

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

typo here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually did that deliberately to try to indicate that step can also be null... happy to remove if you prefer?

rangeInputWrapperStyle: computed('min', 'max', 'value', 'sliderProgress', function() {
let { min, max, value: current, sliderProgress } = this.getProperties('min', 'max', 'value', 'sliderProgress');
let styleProps = assign({ min, max, current }, {
current,
Copy link
Member

Choose a reason for hiding this comment

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

is this current needed here, since it's also in the object in which it's merged?

Copy link
Member Author

Choose a reason for hiding this comment

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

Eagle-eyes @vladucu 😅 Thanks, this was left over from a previous iteration 👍

actions: {
handleChange(event) {
let onChange = this.get('onChange');
if (isNone(onChange)) {
Copy link
Member

Choose a reason for hiding this comment

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

since we make this a no-op for us, we can probably remove this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can do, was just following the React implementation which has onChange as a required argument but still makes this check 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

yeah, fine with me to leave it too....nothing bad here

step={{step}}
value={{value}}
disabled={{disabled}}
oninput={{action "handleChange"}}
Copy link
Member

Choose a reason for hiding this comment

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

why not onchange?

Copy link
Member Author

Choose a reason for hiding this comment

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

onchange only fired once at the end of dragging the slider handle, which meant that the fill on the slider, output value in the tooltip etc. didn't update during dragging. oninput seemed to fix that.

@andrewpye andrewpye merged commit 04c0c97 into update-to-2.2 Jul 4, 2018
@andrewpye andrewpye deleted the add-range-slider-component branch July 4, 2018 10:33
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.

None yet

2 participants