mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(searchbar): use dir attribute for rtl
This commit is contained in:
@ -256,7 +256,7 @@ export class Searchbar {
|
|||||||
* Positions the input placeholder
|
* Positions the input placeholder
|
||||||
*/
|
*/
|
||||||
positionPlaceholder() {
|
positionPlaceholder() {
|
||||||
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
const isRTL = document.dir === 'rtl';
|
||||||
const inputEle = this.$el.querySelector('.searchbar-input') as HTMLElement;
|
const inputEle = this.$el.querySelector('.searchbar-input') as HTMLElement;
|
||||||
const iconEle = this.$el.querySelector('.searchbar-search-icon') 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
|
* Show the iOS Cancel button on focus, hide it offscreen otherwise
|
||||||
*/
|
*/
|
||||||
positionCancelButton() {
|
positionCancelButton() {
|
||||||
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
const isRTL = document.dir === 'rtl';
|
||||||
const cancelButton = this.$el.querySelector('.searchbar-ios-cancel') as HTMLElement;
|
const cancelButton = this.$el.querySelector('.searchbar-ios-cancel') as HTMLElement;
|
||||||
const shouldShowCancel = this.focused;
|
const shouldShowCancel = this.focused;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user