From ca71072e98d16613267cd52302564d22268ed602 Mon Sep 17 00:00:00 2001 From: Sina Date: Thu, 18 May 2017 01:14:11 +0430 Subject: [PATCH 1/2] fix(select): RTL fix for searchbar (#11355) * fix(select): RTL fix for searchbar RTL fix for searchbar component * fix bad reference I forgot to refrence _isRTL * use platform variable instead of method * space indent instead of tab indent * Remove scss changes per request PR - #11342 - covers the scss, and is about done --- src/components/searchbar/searchbar.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/components/searchbar/searchbar.ts b/src/components/searchbar/searchbar.ts index 47a83c7c07..f2e4ea4bea 100644 --- a/src/components/searchbar/searchbar.ts +++ b/src/components/searchbar/searchbar.ts @@ -238,11 +238,19 @@ export class Searchbar extends BaseInput { // Set the input padding start var inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)'; - inputEle.style.paddingLeft = inputLeft; + if (this._plt.isRTL) { + inputEle.style.paddingRight = inputLeft; + } else { + inputEle.style.paddingLeft = inputLeft; + } // Set the icon margin start var iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)'; - iconEle.style.marginLeft = iconLeft; + if (this._plt.isRTL) { + iconEle.style.marginRight = iconLeft; + } else { + iconEle.style.marginLeft = iconLeft; + } } } @@ -257,11 +265,19 @@ export class Searchbar extends BaseInput { var cancelStyle = cancelStyleEle.style; this._isCancelVisible = showShowCancel; if (showShowCancel) { - cancelStyle.marginRight = '0'; + if (this._plt.isRTL) { + cancelStyle.marginLeft = '0'; + } else { + cancelStyle.marginRight = '0'; + } } else { var offset = cancelStyleEle.offsetWidth; if (offset > 0) { - cancelStyle.marginRight = -offset + 'px'; + if (this._plt.isRTL) { + cancelStyle.marginLeft = -offset + 'px'; + } else { + cancelStyle.marginRight = -offset + 'px'; + } } } } From 3443ffdc3a1e6150a02142173541f65a936033a8 Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Wed, 17 May 2017 23:53:40 +0300 Subject: [PATCH 2/2] fix(searchbar): searchbar padding should be on the left (#11651) --- src/components/searchbar/searchbar.ios.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/searchbar/searchbar.ios.scss b/src/components/searchbar/searchbar.ios.scss index a0babeacaa..0afc207879 100644 --- a/src/components/searchbar/searchbar.ios.scss +++ b/src/components/searchbar/searchbar.ios.scss @@ -139,7 +139,7 @@ $searchbar-ios-toolbar-input-background: rgba(0, 0, 0, .08) !default; // ----------------------------------------- .searchbar-ios .searchbar-ios-cancel { - @include padding(0, 8px, 0, 0); + @include padding(0, 0, 0, 8px); @include margin-horizontal(0, null); display: none;