theatre: [Bug] - Type:Number - Multiple inputs break

Using nudgeMultiplier and range currently only uses range.

import { types as t } from '@theatre/core'

sheet
  .object('Example', {
    multiplierWorks: t.number(0, { nudgeMultiplier: 1 }),
    rangeWorks: t.number(0, { range: [-1, 100] }),
    nudgeError: t.number(0, { nudgeMultiplier: 1, range: [-1, 100] }),
  })
  .onValuesChange((values: any) => {
    console.log(values)
  })

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 31 (31 by maintainers)

Most upvoted comments

I’ll review tomorrow 😉

@tomorrowevening thanks for #368 😃 I’m no longer working on Theatre so I can’t review your PR. I’ll pass it on to @AriaMinaei and @AndrewPrifer.

Also i’m questionning the choice of “nudgeMultiplier” name, why not simply “step” ?

I’m experiencing the same

Any news about that ?

Just as UX modifier would be fine imo, it make sense only using mouse. I’m ok with keeping nudgeMultiplier as it is now, what we really need is to be able to use both range and nudgemultiplier at the same time

Well maybe we can release it in the next major version and let users know ? I’m assuiming users are aware theatre.js is still under heavy developement and api could change frequently.

“Step” seems more clear, less writing too

I would expect to step (nudgeMultiplier) value inside the range. So for a defined [1,2] range with 0.1 nudgeMultiplier, options are 1, 1.1 … 1.9, 2

I don’t think ignoreNudgeMultiplier is necessary

I think you’re over thinking the issue, adding an additional variable isn’t necessary, just addressing the current method:

deltaFraction * (range[1] - range[0]) * magnitude * config.nudgeMultiplier

won’t always necessarily return the nudged value amount if the starting value isn’t the same, so if I want the number to nudge by 1, but the starting value is 0.1, then every increment will be 1.1, 2.1, etc, rather than the intended integers.

I’d also advice to keep the nudgeMultiplier to a positive number, inversion feels counterintuitive to UI

Thanks for the bug report @tomorrowevening! I’ll try to take a closer look at this next week 😃