diff --git a/res/css/views/elements/_Field.scss b/res/css/views/elements/_Field.scss index 1fcd238c23c..4f6e868249c 100644 --- a/res/css/views/elements/_Field.scss +++ b/res/css/views/elements/_Field.scss @@ -36,14 +36,12 @@ limitations under the License. border-color: $input-focused-border-color; } -.mx_Field input::placeholder, -.mx_Field select::placeholder { +.mx_Field input::placeholder { transition: color 0.25s ease-in 0s; color: transparent; } -.mx_Field input:placeholder-shown:focus::placeholder, -.mx_Field select:placeholder-shown:focus::placeholder { +.mx_Field input:placeholder-shown:focus::placeholder { transition: color 0.25s ease-in 0.1s; color: $greyed-fg-color; } @@ -66,8 +64,7 @@ limitations under the License. .mx_Field input:focus + label, .mx_Field input:not(:placeholder-shown) + label, -.mx_Field select:focus + label, -.mx_Field select:not(:placeholder-shown) + label { +.mx_Field select:focus + label { transition: font-size 0.25s ease-out 0s, color 0.25s ease-out 0s, diff --git a/src/components/views/elements/Field.js b/src/components/views/elements/Field.js index 896eff5918a..69b890b9112 100644 --- a/src/components/views/elements/Field.js +++ b/src/components/views/elements/Field.js @@ -36,12 +36,12 @@ export default class Field extends React.PureComponent { render() { const extraProps = Object.assign({}, this.props); - // Remove explicit props - delete extraProps.id; - delete extraProps.type; - delete extraProps.placeholder; - delete extraProps.label; + // Remove explicit properties that shouldn't be copied delete extraProps.element; + delete extraProps.children; + + // Set some defaults for the element + extraProps.type = extraProps.type || "text"; const element = this.props.element || "input"; const fieldInput = React.createElement(element, extraProps, this.props.children);