You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SliderField displays count and also controls its value via onChange callback. There's also another actor that can control the value - Button with onClick callback which causes "external" state change.
The last piece is formatValue function that just bypasses slider's internal value, but also peeks slider's internal value as well as count state.
What's the expected behaviour?
The expected behaviour is to see slider's value change whenever it's controled via slider itself (this works fine), but also to see slider's value being updated properly whenever state is changed externally, for example via reset button.
Unfortunately, only the slider's position is updated when state changes externally, the slider's value is stuck on the latest value set by slider itself. This is captured on a screencast below, notice the slider's value in upper right corner.
slider-bug.mov
Help us reproduce the bug!
Here's minimal project React + Vite that uses @aws-amplify/ui-react. You can run it and play around with the application. You can also peek internal slider's value as well as count state via console as they're logged whenever renderValue function is called.
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Primitive components
How is your app built?
Vite
What browsers are you seeing the problem on?
Chrome, Safari
Which region are you seeing the problem in?
Not applicable
Please describe your bug.
SliderField
rendered value is not updated if state is changed externally. Consider following example:SliderField
displayscount
and also controls its value viaonChange
callback. There's also another actor that can control the value - Button withonClick
callback which causes "external" state change.The last piece is
formatValue
function that just bypasses slider's internal value, but also peeks slider's internal value as well ascount
state.What's the expected behaviour?
The expected behaviour is to see slider's value change whenever it's controled via slider itself (this works fine), but also to see slider's value being updated properly whenever state is changed externally, for example via reset button.
Unfortunately, only the slider's position is updated when state changes externally, the slider's value is stuck on the latest value set by slider itself. This is captured on a screencast below, notice the slider's value in upper right corner.
slider-bug.mov
Help us reproduce the bug!
Here's minimal project React + Vite that uses
@aws-amplify/ui-react
. You can run it and play around with the application. You can also peek internal slider's value as well ascount
state via console as they're logged wheneverrenderValue
function is called.Code Snippet
Provided above
Console log output
Available when running stackblitz project
Additional information and screenshots
Project's
package.json
:The text was updated successfully, but these errors were encountered: