Skip to content

Commit b00b02b

Browse files
authored
fix(ui5-input): inner input padding is correctly updated (#3015)
Prevously, after padding: 0 was applied when the condition is false, it remained 0. That could be easily reproduced with native HTML as well. Setting 'undefined' as a value does not change the padding to the one specified in the component's css styles. https://snippix.only.sap/snippets/52143 Now, when the padding should not be 0, the inline style is removed, instead of setting 'undefined' as a value FIXES: #2940
1 parent 4b83c7b commit b00b02b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/main/src/Input.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ class Input extends UI5Element {
11431143
}
11441144

11451145
get styles() {
1146-
return {
1146+
const stylesObject = {
11471147
popoverHeader: {
11481148
"max-width": `${this._inputWidth}px`,
11491149
},
@@ -1155,10 +1155,14 @@ class Input extends UI5Element {
11551155
suggestionsPopover: {
11561156
"max-width": `${this._inputWidth}px`,
11571157
},
1158-
innerInput: {
1159-
padding: this.nativeInputWidth < 48 ? "0" : undefined,
1160-
},
1158+
innerInput: {},
11611159
};
1160+
1161+
if (this.nativeInputWidth < 48) {
1162+
stylesObject.innerInput.padding = "0";
1163+
}
1164+
1165+
return stylesObject;
11621166
}
11631167

11641168
get suggestionSeparators() {

0 commit comments

Comments
 (0)