Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html validation of "Insert a whole number" is broken #1022

Open
3 tasks done
brprice opened this issue Aug 9, 2023 · 2 comments
Open
3 tasks done

Html validation of "Insert a whole number" is broken #1022

brprice opened this issue Aug 9, 2023 · 2 comments
Assignees

Comments

@brprice
Copy link
Contributor

brprice commented Aug 9, 2023

Code of conduct

  • I've read the project's code of conduct, and agree to follow it.

Don't report security issues here

  • I've read the project's security policy, and I do not believe this bug is a security issue.

Is there an existing issue?

  • I've searched GitHub Issues, and I believe this is a new issue

What happened?

Started a new program, and used the action "Insert a whole number". The input box will accept any garbage (e.g. "abc"), and does not complain that it is not a number. (Unlike the "Insert a character", which validates that there is only one character added.)

What should have happened?

There should be something preventing me from submitting a nonsense string where a number is expected.

Which component(s) or aspect(s) of the project are the source of the issue?

one or more React components

Developers, please provide the output of the bug report script

No response

Which browser(s) exhibit the issue, if applicable?

Firefox

On which platform(s) does your browser exhibit the issue, if applicable?

Linux

Do you have a reproducer?

No response

Any additional information?

I'm sure that this used to work, and that bit of the source (components/ActionInput/index.tsx) has not changed. I have probably updated my Firefox since then. The new, broken version of firefox is 116.0.

Looking at the docs, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Character_classes, I do not see any problem with the regex in the attribute pattern="[-+]?[0-9]+". Indeed, running a roughly-equivalent example in the browser's javascript console: new RegExp("[-+]?[0-9]+").test("-3") works as expected.

Does anyone else see this bug, and on what browsers? Could this possibly be a Firefox bug?

@georgefst
Copy link
Contributor

Does anyone else see this bug, and on what browsers? Could this possibly be a Firefox bug?

I see this bug on Firefox, and the correct behaviour on Safari.

@brprice
Copy link
Contributor Author

brprice commented Aug 9, 2023

Does anyone else see this bug, and on what browsers? Could this possibly be a Firefox bug?

I see different behaviour for different FF versions (all from nixpkgs e9ca92b55bed47696cc7cc25d3f854a1e2e01f86)

  • 116.0b8: (nixpkgs#firefox-beta, and the developer edition nixpkgs#firefox-devedition) bad behaviour
  • 116.0: (firefox, the default nixos firefox version) bad behaviour
  • 115.1.0esr: (firefox-esr-115) good behaviour
  • 102.14.0esr: (firefox-esr-102) good behaviour

And on nixpkgs da5adce0ffaff10f6d0fee72a02a5ed9d01b52fc

  • 117.0 has the bad behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants