vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.78k stars 729 forks source link

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

Open Flamenco opened 7 years ago

Flamenco commented 7 years ago

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
Legioth commented 7 years ago

Do you mean that you have javascript that sets the inline style of some elements to initial or auto of the root of some component after some other value has been set by Vaadin Framework?

In that case, you might also have other problems than SIZE_PATTERN since the framework will always reset the size to the value set from the server whenever there's any state change for that component.

On the other hand, both values you suggest are valid CSS size values, so from that point of view there shouldn't be any objections against allowing those, as long as it doesn't cause any unintended side effects.

Flamenco commented 7 years ago

I have updated the vaadin element from another library. Vaadin reads the client-side style value of 'initial' and throws an exception when parsing it.

stale[bot] commented 6 years ago

Hello there!

It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe.

There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):

Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too!