diff --git a/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss b/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss index a5d17db0..dc8f366a 100644 --- a/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss +++ b/src/front/Components/DesignSystem/Form/Elements/InputField/classes.module.scss @@ -26,31 +26,27 @@ border: 1px solid $grey-medium; &:focus { - ~.fake-placeholder { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform 0.3s ease-in-out; } } - &:not([value=""]) { - ~.fake-placeholder { + &:not([data-value=""]) { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform; } } &[type="number"] { &:focus { - ~.fake-placeholder { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform 0.3s ease-in-out; } } - &:not([value=""]) { - ~.fake-placeholder { + &:not([data-value=""]) { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform; } } @@ -75,14 +71,13 @@ } } - &:not([value=""]) { - ~.fake-placeholder { + &:not([data-value=""]) { + ~ .fake-placeholder { transform: translateY(-35px); - transition: transform 0.3s ease-in-out; } } - ~.fake-placeholder { + ~ .fake-placeholder { z-index: 2; top: 35%; margin-left: 8px; @@ -90,6 +85,7 @@ pointer-events: none; position: absolute; background: $white; + transition: transform 0.3s ease-in-out; } } } @@ -106,7 +102,7 @@ height: 70px; border: 1px solid $grey-medium; - ~.fake-placeholder { + ~ .fake-placeholder { z-index: 2; top: -12px; margin-left: 8px; @@ -114,6 +110,19 @@ pointer-events: none; position: absolute; background: $white; - // transform: translateY(-35px); + transform: translateY(35px); + transition: transform 0.3s ease-in-out; } -} \ No newline at end of file + + &:focus { + ~ .fake-placeholder { + transform: translateY(0px); + } + } + + &:not([data-value=""]) { + ~ .fake-placeholder { + transform: translateY(0px); + } + } +} diff --git a/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx b/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx index 9071adff..76e79771 100644 --- a/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx +++ b/src/front/Components/DesignSystem/Form/Elements/InputField/index.tsx @@ -40,7 +40,7 @@ export default class InputField extends BaseField { required={this.props.required} ref={this.props.fieldRef} rows={4} - value={value} + data-value={value} onChange={this.onChange} data-has-validation-errors={this.state.errors.length > 0} className={ @@ -61,7 +61,7 @@ export default class InputField extends BaseField { pattern={pattern} onChange={this.onChange} onBlur={this.onBlur} - value={value} + data-value={value} data-has-validation-errors={this.state.errors.length > 0} className={ this.props.className ? [classes["input"], classes[this.props.className]].join(" ") : classes["input"] diff --git a/src/front/Components/DesignSystem/RadioBox/index.tsx b/src/front/Components/DesignSystem/RadioBox/index.tsx index 8119888b..2e13a657 100644 --- a/src/front/Components/DesignSystem/RadioBox/index.tsx +++ b/src/front/Components/DesignSystem/RadioBox/index.tsx @@ -14,7 +14,7 @@ type IProps = { export default class RadioBox extends React.Component { public override render(): JSX.Element { return ( - +