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

Field type number/integer breaks in Chrome/Safari #3217

Closed
peterboorsma opened this issue Jun 1, 2022 · 4 comments · Fixed by #3231
Closed

Field type number/integer breaks in Chrome/Safari #3217

peterboorsma opened this issue Jun 1, 2022 · 4 comments · Fixed by #3231

Comments

@peterboorsma
Copy link
Contributor

I am unable to save or preview a record when there's a number field with a value >1000. This occurs in both Safari and Chrome on MacOs.
No problems with Firefox.
The problem appeared in Bolt 5.1.9.

Example:

The field description in my contenttype:

        season:
            type: number
            mode: integer
            max: 10000

The value in the field (added in an older version of Bolt)
Screenshot 2022-06-01 at 16 10 00

As you can see a message appears, this happens while trying to save the record.

This is the html of this particular field in Chrome/Safari. Note the min and max values.
<input id="field-season" name="fields[season]" type="number" step="1" min="0" max="1000" placeholder class="form-control">

This is the same field in Firefox. Note the absence of the min and max values.
<input id="field-season" name="fields[season]" type="number" step="1" placeholder="" class="form-control">

  • Somehow both Safari and Chrome add min and max values to a number field.
  • The max value set in contenttypes.yaml doesn't seem to come trough.

I tested this on a production website and a clean Bolt 5.1.9 installation.
Tested with:
Firefox 100.0.1 (no issues)
Safari 15.3 (issues)
Chrome 102.0.5005.61 (issues)

Details

Question Answer
Relevant Bolt Version 5.1.9

Bolt 5.1.9

System Information:
Install type: Composer install
Database: mysql 10.5.15-MariaDB - 127.0.0.1 via TCP/IP
PHP version: 8.0.19
Symfony version: v5.4.9
Operating system: Linux - 4.18.0-348.2.1.el8_5.x86_64
Assets version: 5.1.7
File size upload limit: 8 MB
Memory limit: 1024M

Reproduction

  • Add a number field to a contenttype
  • Add a value larger than 1000 to that field in the editor
  • Try to save the record. Now, in Chrome and Safari you are unable to use both the "save changes" and the "Preview" buttons
@bobdenotter
Copy link
Member

Firefox 100.0.1 (no issues)

You say "no issues", but it doesn't work on FF, right?

@peterboorsma
Copy link
Contributor Author

No issues = It DOES work in Firefox (I tested that). At least version 100 on a Mac.

@bobdenotter
Copy link
Member

So, if you set max: 10000 and input 12345, it'll show an error when trying to save?

@peterboorsma
Copy link
Contributor Author

Yes

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

Successfully merging a pull request may close this issue.

2 participants