Skip to content

Commit

Permalink
fix(ui5-input, ui5-multi-combobox): value state popup now aligned pro…
Browse files Browse the repository at this point in the history
…perly in RTL mode (#4310)

Fixes #3830
  • Loading branch information
stbodurov authored Nov 15, 2021
1 parent 75aa36e commit ce0dcd2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,10 @@ class Input extends UI5Element {
return this.valueState !== ValueState.None ? result : "";
}

get _valueStatePopoverHorizontalAlign() {
return this.effectiveDir !== "rtl" ? "Left" : "Right";
}

/**
* This method is relevant for sap_horizon theme only
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/InputPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
hide-arrow
class="ui5-valuestatemessage-popover"
placement-type="Bottom"
horizontal-align="Left"
horizontal-align="{{_valueStatePopoverHorizontalAlign}}"
>
<div slot="header" class="{{classes.popoverValueState}}" style="{{styles.popoverHeader}}">
<ui5-icon class="ui5-input-value-state-message-icon" name="{{_valueStateMessageInputIcon}}"></ui5-icon>
Expand Down
4 changes: 4 additions & 0 deletions packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,10 @@ class MultiComboBox extends UI5Element {
return (this._isFocusInside || this.open) && !this.readonly;
}

get _valueStatePopoverHorizontalAlign() {
return this.effectiveDir !== "rtl" ? "Left" : "Right";
}

get classes() {
return {
popover: {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/MultiComboBoxPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
hide-arrow
class="ui5-valuestatemessage-popover"
placement-type="Bottom"
horizontal-align="Left"
horizontal-align="{{_valueStatePopoverHorizontalAlign}}"
>
<div slot="header" class="{{classes.popoverValueState}}" style="{{styles.popoverHeader}}">
<ui5-icon class="ui5-input-value-state-message-icon" name="{{_valueStateMessageIcon}}"></ui5-icon>
Expand Down

0 comments on commit ce0dcd2

Please sign in to comment.