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

Correct column widths #26096

Closed
lukewalczak opened this issue Oct 14, 2020 · 0 comments · Fixed by #26757
Closed

Correct column widths #26096

lukewalczak opened this issue Oct 14, 2020 · 0 comments · Fixed by #26757
Assignees
Labels
[Block] Columns Affects the Columns Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@lukewalczak
Copy link
Member

Describe the bug
After using UnitControls in `Columns introduced in the PR there is a regression in distributing columns width.

Basically some functions such as hasExplicitColumnWidths or toWidthPrecision from columns/utils.js cannot work since there is a check Number.isFinite(value). Value always comes with the unit, so the result is false. Unfortunately it has an effect on columns width distribution (please notice that on presented gif, the third column width is different)

before PR after PR
before_pr after_pr

Function called getTotalColumnsWidth used within getRedistributedColumnWidths sums the width attribute of the individual column defined in % (correct me if I'm wrong). With the approach where width can be defined in different units, function mentioned above should take into account somehow.

To reproduce
Steps to reproduce the behavior:

  1. Open a post
  2. Add columns block
  3. Choose variation 30/70
  4. Add third column
  5. Observe width is not distributed properly

Expected behavior

Width should be distributed properly as before introducing the UnitControls

Screenshots

Added above

Editor version (please complete the following information):

  • Gutenberg 9.2

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 86.0.4240.75
@lukewalczak lukewalczak added [Type] Bug An existing feature does not function as intended [Block] Columns Affects the Columns Block labels Oct 14, 2020
@tellthemachines tellthemachines self-assigned this Nov 5, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 6, 2020
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 [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants