Skip to content

Commit

Permalink
Merge pull request #144 from novlan1/feature/slider-input
Browse files Browse the repository at this point in the history
feat(slider): 与input联动
  • Loading branch information
duenyang authored Sep 26, 2024
2 parents 9827b40 + e8a2753 commit 2b51413
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/slider/slider-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export default class SliderButton extends Component<SliderButtonProps> {
strategy="absolute"
content={this.getTooltipContent()}
visible={props.label && this.visible.value}
style={{ height: '100%' }}
>
<div className={classname(`${this.className}`, { [`${this.className}--dragging`]: this.dragging.value })} />
</t-tooltip>
Expand Down
7 changes: 5 additions & 2 deletions src/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default class Slider extends Component<SliderProps> {
{
<t-input-number
class={sliderNumberClass}
value={range ? this.firstValue : this.prevValue}
value={range ? this.firstValue.value : this.prevValue.value}
ref={this.leftInputRef}
step={this.props.step}
onChange={(v: number) => {
Expand All @@ -343,13 +343,16 @@ export default class Slider extends Component<SliderProps> {
{range && (
<t-input-number
className={sliderNumberClass}
value={this.secondValue}
value={this.secondValue.value}
ref={this.rightInputRef}
step={this.props.step}
disabled={this.props.disabled}
min={min}
max={max}
props={this.calcInputNumberProps}
onChange={(v: number) => {
this.secondValue.value = v;
}}
/>
)}
</div>
Expand Down

0 comments on commit 2b51413

Please sign in to comment.