Skip to content

Animation fps limit setting doesn't reset on blur after entering an invalid value #8326

Description

@Leonabcd123

Did you clear cache before opening an issue?

  • I have cleared my cache

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Does the issue happen when logged in?

Yes

Does the issue happen when logged out?

Yes

Does the issue happen in incognito mode when logged in?

Yes

Does the issue happen in incognito mode when logged out?

Yes

Account name

No response

Account config

No response

Current Behavior

When the animation fps limit setting it set to native, an invalid value is entered in the field below, and the field is blurred, the invalid value remains and isn't emptied.

Expected Behavior

Field should empty on blur if an invalid value has been entered and the current value is native.

Steps To Reproduce

  1. Go to https://monkeytype.com/settings?highlight=animationFpsLimit
  2. Click on native
  3. In the field below it, enter asdf
  4. Click outside of the field
  5. Notice how asdf remains in the field

Environment

  • OS: Arch Linux
  • Browser: Firefox
  • Browser Version: 151.0.4

Anything else?

A very brief summary of my debugging attempt:

When the attribute list of an element contains spreads:

{...getNumberOptions(props.schema)}
{...getDateOptions(props.schema, formatDate)}

solidjs compiles the code differently, causing it to use the spread function, rather than using direct assignment via effect. When using spread, it will only write to the dom (element.value = ...) if the return value of convertValueToString changes, rather than writing whenever props.field().state.value changes. In the case of our animation fps limit setting, typing asdf will set props.field().state.value to undefined (which gets converted to an empty string by convertValueToString:

if (input === undefined || input === null) return "";

And when we reset on blur, we reset to the default value which is also an empty string. The value hasn't changed, so solid doesn't write to the dom and as a result the invalid value isn't removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions