Restyle a ternary
parent
5b97b95c62
commit
8d65961be2
|
@ -81,12 +81,10 @@ const factory = (FontIcon) => {
|
|||
const element = this.refs.input;
|
||||
// compute the height difference between inner height and outer height
|
||||
const style = getComputedStyle(element, null);
|
||||
let heightOffset = 0;
|
||||
if (style.boxSizing === 'content-box') {
|
||||
heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
|
||||
} else {
|
||||
heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
|
||||
}
|
||||
const heightOffset = style.boxSizing === 'content-box'
|
||||
? -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom))
|
||||
: parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
|
||||
|
||||
// resize the input to its content size
|
||||
element.style.height = 'auto';
|
||||
element.style.height = `${element.scrollHeight + heightOffset}px`;
|
||||
|
|
Loading…
Reference in New Issue