Safari & Firefox fixes

This commit is contained in:
Jake Archibald
2018-10-18 17:39:20 +01:00
parent e260646940
commit 2e65f8ad73
2 changed files with 15 additions and 7 deletions

View File

@@ -31,6 +31,15 @@ export default class Range extends Component<Props, State> {
return ( return (
<label class={style.range}> <label class={style.range}>
<span class={style.labelText}>{children}</span> <span class={style.labelText}>{children}</span>
{/* On interaction, Safari gives focus to the first element in the label, so the
<range-input> is deliberately first. */}
<div class={style.rangeWcContainer}>
<range-input
ref={linkRef(this, 'rangeWc')}
class={style.rangeWc}
{...otherProps}
/>
</div>
<input <input
type="number" type="number"
class={style.textInput} class={style.textInput}
@@ -39,13 +48,6 @@ export default class Range extends Component<Props, State> {
max={max} max={max}
onInput={this.onTextInput} onInput={this.onTextInput}
/> />
<div class={style.rangeWcContainer}>
<range-input
ref={linkRef(this, 'rangeWc')}
class={style.rangeWc}
{...otherProps}
/>
</div>
</label> </label>
); );
} }

View File

@@ -8,6 +8,7 @@
} }
.range-wc-container { .range-wc-container {
grid-row: 2 / 3;
grid-column: 1 / 3; grid-column: 1 / 3;
} }
@@ -16,6 +17,9 @@
} }
.text-input { .text-input {
grid-row: 1 / 2;
grid-column: 2 / 3;
text-align: right; text-align: right;
background: transparent; background: transparent;
color: inherit; color: inherit;
@@ -36,6 +40,8 @@
// Remove the number controls // Remove the number controls
-moz-appearance: textfield;
&::-webkit-outer-spin-button, &::-webkit-outer-spin-button,
&::-webkit-inner-spin-button { &::-webkit-inner-spin-button {
-moz-appearance: none; -moz-appearance: none;