diff --git a/src/components/controls/TextArea/TextArea.scss b/src/components/controls/TextArea/TextArea.scss index 93f2155aaf..c1013c5258 100644 --- a/src/components/controls/TextArea/TextArea.scss +++ b/src/components/controls/TextArea/TextArea.scss @@ -64,7 +64,7 @@ $block: '.#{variables.$ns-new}text-area'; &_size { &_s { #{$block}__control { - @include control-mixins.input-control(s); + @include control-mixins.input-control(s, $block); } &#{$block}_has-clear #{$block}__control { @@ -76,7 +76,7 @@ $block: '.#{variables.$ns-new}text-area'; &_m { #{$block}__control { - @include control-mixins.input-control(m); + @include control-mixins.input-control(m, $block); } &#{$block}_has-clear #{$block}__control { @@ -88,7 +88,7 @@ $block: '.#{variables.$ns-new}text-area'; &_l { #{$block}__control { - @include control-mixins.input-control(l); + @include control-mixins.input-control(l, $block); } &#{$block}_has-clear #{$block}__control { @@ -100,7 +100,7 @@ $block: '.#{variables.$ns-new}text-area'; &_xl { #{$block}__control { - @include control-mixins.input-control(xl); + @include control-mixins.input-control(xl, $block); } &#{$block}_has-clear #{$block}__control { diff --git a/src/components/controls/TextArea/TextArea.tsx b/src/components/controls/TextArea/TextArea.tsx index b94ec7635f..5ddd25715b 100644 --- a/src/components/controls/TextArea/TextArea.tsx +++ b/src/components/controls/TextArea/TextArea.tsx @@ -1,6 +1,7 @@ import React from 'react'; import {useForkRef, useUniqId} from '../../../hooks'; +import {useMobile} from '../../mobile'; import {blockNew} from '../../utils/cn'; import {ClearButton, mapTextInputSizeToButtonSize} from '../common'; import {OuterAdditionalContent} from '../common/OuterAdditionalContent/OuterAdditionalContent'; @@ -63,6 +64,8 @@ export const TextArea = React.forwardRef(functio onChange, } = props; + const [mobile] = useMobile(); + const {errorMessage, validationState} = errorPropsMapper({ error, errorMessage: errorMessageProp, @@ -160,6 +163,7 @@ export const TextArea = React.forwardRef(functio style={style} className={b( { + mobile, view, size, disabled, diff --git a/src/components/controls/TextInput/TextInput.scss b/src/components/controls/TextInput/TextInput.scss index 437a93584d..d92551a6ad 100644 --- a/src/components/controls/TextInput/TextInput.scss +++ b/src/components/controls/TextInput/TextInput.scss @@ -105,7 +105,7 @@ $block: '.#{variables.$ns}text-input'; &_size { &_s { #{$block}__control { - @include control-mixins.input-control(s); + @include control-mixins.input-control(s, $block); } #{$block}__label { @@ -135,7 +135,7 @@ $block: '.#{variables.$ns}text-input'; &_m { #{$block}__control { - @include control-mixins.input-control(m); + @include control-mixins.input-control(m, $block); } #{$block}__label { @@ -165,7 +165,7 @@ $block: '.#{variables.$ns}text-input'; &_l { #{$block}__control { - @include control-mixins.input-control(l); + @include control-mixins.input-control(l, $block); } #{$block}__label { @@ -195,7 +195,7 @@ $block: '.#{variables.$ns}text-input'; &_xl { #{$block}__control { - @include control-mixins.input-control(xl); + @include control-mixins.input-control(xl, $block); } #{$block}__label { diff --git a/src/components/controls/TextInput/TextInput.tsx b/src/components/controls/TextInput/TextInput.tsx index f85d91cc13..0db447c86a 100644 --- a/src/components/controls/TextInput/TextInput.tsx +++ b/src/components/controls/TextInput/TextInput.tsx @@ -6,6 +6,7 @@ import {useForkRef, useUniqId} from '../../../hooks'; import {useElementSize} from '../../../hooks/private'; import {Icon} from '../../Icon'; import {Popover} from '../../Popover'; +import {useMobile} from '../../mobile'; import {block} from '../../utils/cn'; import {ClearButton, mapTextInputSizeToButtonSize} from '../common'; import {OuterAdditionalContent} from '../common/OuterAdditionalContent/OuterAdditionalContent'; @@ -80,6 +81,8 @@ export const TextInput = React.forwardRef(funct onChange, } = props; + const [mobile] = useMobile(); + const {errorMessage, errorPlacement, validationState} = errorPropsMapper({ error, errorMessage: errorMessageProp, @@ -193,6 +196,7 @@ export const TextInput = React.forwardRef(funct style={style} className={b( { + mobile, view, size, disabled, diff --git a/src/components/controls/mixins.scss b/src/components/controls/mixins.scss index 4710dbc5c5..32c2109193 100644 --- a/src/components/controls/mixins.scss +++ b/src/components/controls/mixins.scss @@ -2,7 +2,7 @@ @use '../variables.scss'; @use './variables.scss' as control-variables; -@mixin input-control($size) { +@mixin input-control($size, $block) { @if $size == 's' { @include mixins.text-body-short; @@ -27,4 +27,8 @@ height: #{variables.$xl-height - control-variables.$border-width * 2}; padding: 11px 12px; } + + @at-root #{$block}_mobile#{&} { + font-size: control-variables.$mobile-safari-font-size; + } } diff --git a/src/components/controls/variables.scss b/src/components/controls/variables.scss index 17f36d5dfa..1bcf913a9f 100644 --- a/src/components/controls/variables.scss +++ b/src/components/controls/variables.scss @@ -1 +1,4 @@ $border-width: 1px; +// Safari on iOS zoom page if input font-size is smaller than 16px +// https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/ +$mobile-safari-font-size: 16px;