widget: fix geometry style update (properly apply 'auto')

This commit is contained in:
jean-emmanuel 2019-01-07 19:25:05 +01:00
parent 81af47ea9b
commit 8c37b06060
2 changed files with 10 additions and 4 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 0.41.2
- bug fixes
- geometry properties not properly applied when reset to `auto`
## 0.41.1
- bug fixes

View file

@ -780,11 +780,12 @@ class Widget extends EventEmitter {
geometry = parseFloat(val) == val ? parseFloat(val)+'rem' : val
}
if (geometry && geometry != 'auto') {
if (geometry) {
if (geometry === 'auto') geometry = ''
this.container.style[d] = geometry
if (d == 'width') this.container.style.minWidth = geometry
if (d == 'height') this.container.style.minHeight = geometry
if (d == 'top' || d == 'left') this.container.classList.add('absolute-position')
if (d === 'width') this.container.style.minWidth = geometry
if (d === 'height') this.container.style.minHeight = geometry
if (d === 'top' || d === 'left') this.container.classList.add('absolute-position')
}
}