Display label within input using selected colour
[MAILPOET-2908]
This commit is contained in:
@@ -53,7 +53,25 @@ const TextInputEdit = ({
|
|||||||
inputStyles.backgroundColor = styles.backgroundColor;
|
inputStyles.backgroundColor = styles.backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTextInput = (placeholder) => (
|
const placeholderStyle = {};
|
||||||
|
|
||||||
|
if (styles.fontColor && !styles.inheritFromTheme) {
|
||||||
|
inputStyles.color = styles.fontColor;
|
||||||
|
if (labelWithinInput) {
|
||||||
|
placeholderStyle.color = styles.fontColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getTextInput = (placeholder) => {
|
||||||
|
let style = '';
|
||||||
|
if (placeholderStyle.color !== undefined) {
|
||||||
|
style = `#${id}::placeholder {color: ${placeholderStyle.color};}`;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<style>
|
||||||
|
{style}
|
||||||
|
</style>
|
||||||
<input
|
<input
|
||||||
id={id}
|
id={id}
|
||||||
ref={input}
|
ref={input}
|
||||||
@@ -65,7 +83,9 @@ const TextInputEdit = ({
|
|||||||
style={inputStyles}
|
style={inputStyles}
|
||||||
onFocus={() => input.current.blur()}
|
onFocus={() => input.current.blur()}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ParagraphEdit className={className}>
|
<ParagraphEdit className={className}>
|
||||||
|
Reference in New Issue
Block a user