fix(searchbar): use dir attribute for rtl

This commit is contained in:
Brandy Carney
2017-07-17 11:01:26 -04:00
parent 3d5ed7e81f
commit c383fd6a54

View File

@ -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;