vaadin / vaadin/framework

Update SizeWithUnit.parseStringSize to allow 'initial' and 'auto'

Open Beginner friendly
#9,457 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

I have a javascript function that directly modifies element element CSS styles. If I set the width or height to 'initial', Vaadin throws an error when reading the element.

The initial and auto incoming values can be simply replaced with an empty string. The empty string is allowed in the SharedUtil.SIZE_PATTERN regex and has the same effect.

I will submit a fix, but I want make sure there is no disagreement.

vaadin allow initial

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SizeWithUnit.parseStringSize and inspect how it uses SharedUtil.SIZE_PATTERN when reading width or height values. Verify handling for the incoming values 'initial' and 'auto', then confirm parsing no longer throws and that the resulting value has the same effect as an empty string.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.