-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
There was a problem hiding this 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?} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here ?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🤷♂️
There was a problem hiding this comment.
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"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not onchange
?
There was a problem hiding this comment.
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.
…r-polaris into add-range-slider-component
Adds a full implementation of the Polaris range slider component: