Skip to content

Commit 9112150

Browse files
authored
Fix textfield arabic placeholder clipping (#1450)
1 parent 37273c5 commit 9112150

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/@adobe/spectrum-css-temp/components/textfield/index.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ governing permissions and limitations under the License.
9393
&.is-placeholder {
9494
font-weight: var(--spectrum-textfield-placeholder-text-font-weight);
9595
font-style: var(--spectrum-textfield-placeholder-text-font-style);
96+
font-synthesis: none;
9697
transition: color var(--spectrum-global-animation-duration-100) ease-in-out;
9798
opacity: 1;
9899
}
@@ -107,7 +108,10 @@ governing permissions and limitations under the License.
107108
opacity: 1;
108109
}
109110

110-
&:lang(ja), &:lang(zh), &:lang(ko) {
111+
/* placeholder gets clipped for synthetic italics, we rely on font-synthesis once
112+
* chrome supports it https://bugs.chromium.org/p/chromium/issues/detail?id=509989
113+
*/
114+
&:lang(ja), &:lang(zh), &:lang(ko), &:lang(ar), &:lang(he) {
111115
&::placeholder,
112116
&.is-placeholder {
113117
font-style: normal;

packages/@react-spectrum/textfield/stories/Textfield.stories.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ storiesOf('TextField', module)
120120
)
121121
.add('custom width small, labelPosition: side',
122122
() => render({icon: <Info />, validationState: 'invalid', width: '30px', labelPosition: 'side'})
123+
)
124+
.add('placeholder arabic',
125+
() => render({placeholder: 'أدخل رقماً'})
123126
);
124127

125128
function render(props = {}) {

0 commit comments

Comments
 (0)