Skip to content
Snippets Groups Projects
Commit b45a3cf7 authored by Alexander Rose's avatar Alexander Rose
Browse files

add callOnChangeWhileSliding to Slider component

parent 5a2a727f
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ export class Slider extends React.Component<{
value: number,
step?: number,
title?: string,
callOnChangeWhileSliding?: boolean,
onChange: (v: number) => void
}, { value: string }> {
......@@ -57,7 +58,10 @@ export class Slider extends React.Component<{
<div>
<div>
<SliderBase min={this.props.min} max={this.props.max} step={step} value={+this.state.value}
onChange={v => this.setState({ value: '' + v })}
onChange={v => {
this.setState({ value: '' + v });
if (this.props.callOnChangeWhileSliding) this.fire();
}}
onAfterChange={v => this.fire()} />
</div>
</div>
......
......@@ -169,6 +169,7 @@ export class Spacefill extends View<Controller<any>, SpacefillState, { transform
min={0}
max={1}
step={0.01}
callOnChangeWhileSliding={true}
onChange={value => this.update({ alpha: value })}
/>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment