[react] fix: Fix weird slider behaviour when entering default value (#246)
Fixes #212 Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/246 Reviewed-by: Joost De Cock <joostdecock@noreply.codeberg.org> Co-authored-by: Jonathan Haas <haasjona@gmail.com> Co-committed-by: Jonathan Haas <haasjona@gmail.com>
This commit is contained in:
parent
a9f5ba5392
commit
915e52b7d4
1 changed files with 1 additions and 1 deletions
|
@ -233,7 +233,7 @@ export const MenuMmInput = (props) => {
|
|||
/** A {@see SliderInput} to handle percentage values */
|
||||
export const MenuPctInput = ({ current, changed, updateHandler, config, ...rest }) => {
|
||||
const factor = 100
|
||||
let pctCurrent = changed ? menuRoundPct(current, factor) : current
|
||||
let pctCurrent = menuRoundPct(changed ? current : config.dflt, factor)
|
||||
const pctUpdateHandler = useCallback(
|
||||
(path, newVal) =>
|
||||
updateHandler(path, newVal === undefined ? undefined : menuRoundPct(newVal, 1 / factor)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue