You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I disagree. setWidth/Height(null) already does this. setSizeUndefined() is simply a shortcut and IMO poor API; I don't like bloating the interface with even more special-case methods. It could be argued that setWidth(null) is hard to understand, but a better solution would be to add a SIZE_UNDEFINED constant somewhere.
I don't think that setWidth(null) or setWidth("-1px") makes any sense to anyone, what does width = null actually mean? It looks like something that you are doing wrong, and lets not go into the "-1px" hack either.
Using a constant is better, but it doesn't solve the issue either. For one it already exists but more importantly you have to know it exist to use it. And it is non-obvious as you yourself discovered.
That is why two methods, which actually says what the do and can be found with autocomplete, I think is very needed and would make the code much more readable.
Originally by @johndevs
How many times have you only wanted to set the width of a component as undefined and not the both the width and height as undefined?
We should add setWidthUndefined() and setHeightUndefined() methods to AbstractComponent.
Imported from https://dev.vaadin.com/ issue #13546
The text was updated successfully, but these errors were encountered: