Skip to content

Commit 5e4bd83

Browse files
authored
Merge pull request #594 from PolymerElements/fix-rtl-width
fix label width in rtl; add :dir for polymer 2
2 parents e5d116e + 5b6c46c commit 5e4bd83

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

paper-input-char-counter.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
display: none !important;
4646
}
4747

48+
:host(:dir(rtl)),
4849
:host-context([dir="rtl"]) {
4950
float: left;
5051
}

paper-input-container.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
:host {
122122
display: block;
123123
padding: 8px 0;
124+
overflow: hidden;
124125

125126
--paper-input-container-shared-input-style: {
126127
position: relative; /* to make a stacking context */
@@ -259,12 +260,10 @@
259260
@apply --paper-input-container-label-floating;
260261
}
261262

263+
:host(:dir(rtl)) .input-content.label-is-floating ::slotted(label),
264+
:host(:dir(rtl)) .input-content.label-is-floating ::slotted(.paper-input-label),
262265
:host-context([dir="rtl"]) .input-content.label-is-floating ::slotted(label),
263266
:host-context([dir="rtl"]) .input-content.label-is-floating ::slotted(.paper-input-label) {
264-
/* TODO(noms): Figure out why leaving the width at 133% before the animation
265-
* actually makes
266-
* it wider on the right side, not left side, as you would expect in RTL */
267-
width: 100%;
268267
-webkit-transform-origin: right top;
269268
transform-origin: right top;
270269
}
@@ -289,7 +288,7 @@
289288
.input-content ::slotted(iron-input) {
290289
@apply --paper-input-container-shared-input-style;
291290
}
292-
291+
293292
.input-content ::slotted(input),
294293
.input-content ::slotted(textarea),
295294
.input-content ::slotted(iron-autogrow-textarea),
@@ -302,7 +301,7 @@
302301
.input-content ::slotted(input)::-webkit-inner-spin-button {
303302
@apply --paper-input-container-input-webkit-spinner;
304303
}
305-
304+
306305
.input-content.focused ::slotted(input),
307306
.input-content.focused ::slotted(textarea),
308307
.input-content.focused ::slotted(iron-autogrow-textarea),
@@ -316,7 +315,7 @@
316315
.input-content.is-invalid ::slotted(.paper-input-input) {
317316
@apply --paper-input-container-input-invalid;
318317
}
319-
318+
320319
.prefix ::slotted(*) {
321320
display: inline-block;
322321
@apply --paper-font-subhead;

0 commit comments

Comments
 (0)