During an investigation in Slider behavior, I discovered numerous bugs in the control:
1. When slider dragging is initiated by clicking on the **track**, the value changing property is not set on Control (but it is when dragging is initiated from the thumb).
2. When slider dragging is initiated on the thumb, snap to ticks doesn't work until the slider is released; when however initiated on the track, snap to ticks works immediately (this is because one code path calls `adjustValue` while the other uses `setValue`).
3. When just pressing and releasing the thumb, value changing is set and reset, but value wasn't changed at all
4. The slider doesn't take its borders (or backgrounds) into account when calculating the click position. So if the track has a large border or faked border via backgrounds, then clicking on the track border will move the thumb; the thumb itself is also positioned without taking borders into account
5. None of the mouse events on track/thumb are consumed
6. Click/Dragging works with all mouse buttons (secondary, middle click, back, forward...), not just primary
7. In SliderSkin, there are checks in the track event handlers for `!thumb.isPressed()` -- however, this can't ever be `false` due to how events work
8. When dragging is initiated on the thumb, the "pressed" psuedo class is active on the thumb and the thumb gets a darker highlight; however, the same does not occur when the drag is initiated on the track. You can make this more obvious with ".slider .thumb:pressed { -fx-color: red; }" -- it is debatable whether this is a bug (as the thumb wasn't pressed initially), but it does look inconsistent for the user
1. When slider dragging is initiated by clicking on the **track**, the value changing property is not set on Control (but it is when dragging is initiated from the thumb).
2. When slider dragging is initiated on the thumb, snap to ticks doesn't work until the slider is released; when however initiated on the track, snap to ticks works immediately (this is because one code path calls `adjustValue` while the other uses `setValue`).
3. When just pressing and releasing the thumb, value changing is set and reset, but value wasn't changed at all
4. The slider doesn't take its borders (or backgrounds) into account when calculating the click position. So if the track has a large border or faked border via backgrounds, then clicking on the track border will move the thumb; the thumb itself is also positioned without taking borders into account
5. None of the mouse events on track/thumb are consumed
6. Click/Dragging works with all mouse buttons (secondary, middle click, back, forward...), not just primary
7. In SliderSkin, there are checks in the track event handlers for `!thumb.isPressed()` -- however, this can't ever be `false` due to how events work
8. When dragging is initiated on the thumb, the "pressed" psuedo class is active on the thumb and the thumb gets a darker highlight; however, the same does not occur when the drag is initiated on the track. You can make this more obvious with ".slider .thumb:pressed { -fx-color: red; }" -- it is debatable whether this is a bug (as the thumb wasn't pressed initially), but it does look inconsistent for the user
- is blocked by
-
JDK-8349714 Slider allows user to set any value when snapToTicks is true
-
- Open
-