palantir/blueprint

Slider Handle goes out of bounds when provided values lower/higher than min/max

Open

#4,285 建立於 2020年8月18日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
P3Package: coreType: bughelp wanted

描述

Environment

  • Package version(s): 3.25.0
  • Operating System: Ubuntu 18.04
  • Browser name and version: Chrome 84

Code Sandbox

sandbox

Steps to reproduce

  1. Create a slider (also works for multislider)
  2. Provide min/max props
  3. Set the value to be greater than max value

Actual behavior

The handle goes out of bounds and floats to the side

Expected behavior

Should filter the value under the hood

Possible solution

.filter(value => value > min] && value < max) under the hood

This specifically came up because I'm trying to sync a slider with a d3 graph which zooms. I think everything works pretty nicely except for this out of bounds issue. I understand that this wouldn't happen under normal use of the slider where you would only be able to set the value prop of the slider by dragging and setting on the slider, but I also don't think this would be difficult/performance heavy.

貢獻者指南