From c383fd6a545769f8ca858551dda799f0adbb4124 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Mon, 17 Jul 2017 11:01:26 -0400 Subject: [PATCH] fix(searchbar): use dir attribute for rtl --- packages/core/src/components/searchbar/searchbar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/components/searchbar/searchbar.tsx b/packages/core/src/components/searchbar/searchbar.tsx index ae5b7d33fa..01acfbf1e2 100644 --- a/packages/core/src/components/searchbar/searchbar.tsx +++ b/packages/core/src/components/searchbar/searchbar.tsx @@ -256,7 +256,7 @@ export class Searchbar { * Positions the input placeholder */ positionPlaceholder() { - const isRTL = document.documentElement.getAttribute('dir') === 'rtl'; + const isRTL = document.dir === 'rtl'; const inputEle = this.$el.querySelector('.searchbar-input') as HTMLElement; const iconEle = this.$el.querySelector('.searchbar-search-icon') as HTMLElement; @@ -296,7 +296,7 @@ export class Searchbar { * Show the iOS Cancel button on focus, hide it offscreen otherwise */ positionCancelButton() { - const isRTL = document.documentElement.getAttribute('dir') === 'rtl'; + const isRTL = document.dir === 'rtl'; const cancelButton = this.$el.querySelector('.searchbar-ios-cancel') as HTMLElement; const shouldShowCancel = this.focused;