Support » Fixing WordPress » RangeControl input has no limit

  • I have noticed that users can add any number into the RangeControl input (Value entry field). I’m just wondering if there is a way to make it impossible for users to add a number higher than max in the RangeControl?

    I’m using WordPress 5.1.1 and the core editor.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Your reference to max is about this correct?

    https://wordpress.org/gutenberg/handbook/designers-developers/developers/components/range-control/#max

    If so, there isn’t a way to stop it. They can always just open up the browser console and modify the HTML/JS directly to whatever value they like. However, you can always code it so that if the value is higher than the max it won’t accept it.

    • This reply was modified 3 years, 3 months ago by Jarret.
    Thread Starter Diane Wallace

    (@dianewallace)

    Hi Jarret, I’m more worried about the user accidentily typing a really high number into the input.

    Max doesn’t seem to work as expected; “If higher values are inserted onChange will not be called and the value gets reverted when blur event fires”. You can type in any value above max.

    • This reply was modified 3 years, 3 months ago by Diane Wallace.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘RangeControl input has no limit’ is closed to new replies.