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

Columns block: Column width's percentage is NaN when using , character as decimal separator #33601

Open
fluiddot opened this issue Jul 21, 2021 · 2 comments
Assignees
Labels
[Block] Columns Affects the Columns Block Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended

Comments

@fluiddot
Copy link
Contributor

Description

Looks like the percentage field only supports the . character as the decimal separator, using other characters like , leads to a NaN value. On iOS, depending on the device's region (in my case I used Spain), the keyboard only allows the option to use the , character as the decimal separator which prevents inputting decimal numbers (see attached screenshots).

Step-by-step reproduction instructions

  1. Go to device settings and change the device's region to one that has a different decimal separator, like for example Spain. On iOS, this setting can be changed in Settings/General/Language & Region/Region.
  2. Add a Columns block.
  3. Open the block settings.
  4. Tap on the width percentage of a column.
  5. Input a decimal number using the , character separator.
  6. Observe that the value is NaN.

Expected behaviour

The column widths' percentage should support the , decimal separator.

Actual behaviour

The column widths' percentage doesn't support the , decimal separator.

Screenshots or screen recording (optional)

Decimal character NaN error

WordPress information

  • WordPress version: N/A
  • Gutenberg version: N/A
  • Are all plugins except Gutenberg deactivated? N/A
  • Are you using a default theme (e.g. Twenty Twenty-One)? N/A

Device information

  • Device: iPhone 11
  • Operating system: iOS 14.2
  • WordPress app version: develop
@fluiddot fluiddot added [Type] Bug An existing feature does not function as intended Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Block] Columns Affects the Columns Block labels Jul 21, 2021
@ceyhun
Copy link
Member

ceyhun commented Jul 21, 2021

Could be related to #33434. I had encountered the same with Button block and em value on that PR, but it was fixed before getting merged.

@fluiddot
Copy link
Contributor Author

Could be related to #33434. I had encountered the same with Button block and em value on that PR, but it was fixed before getting merged.

Yeah, it's most likely related although the solution applied there looks didn't cover the case I mentioned. I see that for the Button radius field when I type the , character it's removed automatically, but that behavior is not replicated on the column width. In fact, I don't think we should discard the character but support convert decimals with the , character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants