Display label within input using selected colour
[MAILPOET-2908]
This commit is contained in:
@@ -53,19 +53,39 @@ const TextInputEdit = ({
|
|||||||
inputStyles.backgroundColor = styles.backgroundColor;
|
inputStyles.backgroundColor = styles.backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTextInput = (placeholder) => (
|
const placeholderStyle = {};
|
||||||
<input
|
|
||||||
id={id}
|
if (styles.fontColor && !styles.inheritFromTheme) {
|
||||||
ref={input}
|
inputStyles.color = styles.fontColor;
|
||||||
className="mailpoet_text"
|
if (labelWithinInput) {
|
||||||
type={name === 'email' ? 'email' : 'text'}
|
placeholderStyle.color = styles.fontColor;
|
||||||
name={name}
|
}
|
||||||
placeholder={placeholder}
|
}
|
||||||
data-automation-id={`editor_${name}_input`}
|
|
||||||
style={inputStyles}
|
const getTextInput = (placeholder) => {
|
||||||
onFocus={() => input.current.blur()}
|
let style = '';
|
||||||
/>
|
if (placeholderStyle.color !== undefined) {
|
||||||
);
|
style = `#${id}::placeholder {color: ${placeholderStyle.color};}`;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<style>
|
||||||
|
{style}
|
||||||
|
</style>
|
||||||
|
<input
|
||||||
|
id={id}
|
||||||
|
ref={input}
|
||||||
|
className="mailpoet_text"
|
||||||
|
type={name === 'email' ? 'email' : 'text'}
|
||||||
|
name={name}
|
||||||
|
placeholder={placeholder}
|
||||||
|
data-automation-id={`editor_${name}_input`}
|
||||||
|
style={inputStyles}
|
||||||
|
onFocus={() => input.current.blur()}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ParagraphEdit className={className}>
|
<ParagraphEdit className={className}>
|
||||||
|
Reference in New Issue
Block a user