FIX: optimizes sk body position in RTL mode (#10997)

This commit is contained in:
Joffrey JAFFEUX 2020-10-22 16:08:11 +02:00 committed by GitHub
parent 85f827ee1c
commit 281bf0b345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -32,6 +32,12 @@ const SELECT_KIT_OPTIONS = Mixin.create({
selectKitOptions: EMPTY_OBJECT,
});
function isDocumentRTL() {
return (
window.getComputedStyle(document.querySelector("html")).direction === "rtl"
);
}
export default Component.extend(
SELECT_KIT_OPTIONS,
PluginApiMixin,
@ -268,7 +274,7 @@ export default Component.extend(
clearOnClick: false,
closeOnChange: true,
limitMatches: null,
placement: "bottom-start",
placement: isDocumentRTL() ? "bottom-end" : "bottom-start",
placementStrategy: null,
filterComponent: "select-kit/select-kit-filter",
selectedNameComponent: "selected-name",

View File

@ -8,7 +8,6 @@ export default Component.extend({
classNameBindings: ["isLoading"],
appendReason: true,
showFullTitle: true,
placement: "bottom-start",
notificationLevel: null,
topic: null,
showCaret: true,

View File

@ -7,7 +7,6 @@
options=(hash
icon=icon
showFullTitle=showFullTitle
placement=placement
preventsClickPropagation=true
showCaret=showCaret
)
@ -22,7 +21,6 @@
options=(hash
icon=icon
showFullTitle=showFullTitle
placement=placement
preventsClickPropagation=true
showCaret=showCaret
)