fix: description label is not focusing on new event-type create modal (#23603)
* fix: description label is not focusing * changes --------- Co-authored-by: Devanshu Sharma <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
1 file changed
+11
-1
@@ -61,7 +61,16 @@ export const Editor = (props: TextEditorProps) => {
|
|||||||
const plainText = props.plainText ?? false;
|
const plainText = props.plainText ?? false;
|
||||||
return (
|
return (
|
||||||
<div className="editor rounded-md">
|
<div className="editor rounded-md">
|
||||||
{props.label && <label className="mb-1 block text-sm font-medium leading-6">{props.label}</label>}
|
{props.label && (
|
||||||
|
<label
|
||||||
|
onClick={() => {
|
||||||
|
const el = document.getElementById("custom-editor");
|
||||||
|
el?.focus();
|
||||||
|
}}
|
||||||
|
className="mb-1 block text-sm font-medium leading-6">
|
||||||
|
{props.label}
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
<LexicalComposer initialConfig={{ ...editorConfig }}>
|
<LexicalComposer initialConfig={{ ...editorConfig }}>
|
||||||
<div className="editor-container hover:border-emphasis focus-within:ring-brand-default !rounded-lg p-0 transition focus-within:ring-2 focus-within:ring-offset-0">
|
<div className="editor-container hover:border-emphasis focus-within:ring-brand-default !rounded-lg p-0 transition focus-within:ring-2 focus-within:ring-offset-0">
|
||||||
<ToolbarPlugin
|
<ToolbarPlugin
|
||||||
@@ -81,6 +90,7 @@ export const Editor = (props: TextEditorProps) => {
|
|||||||
<RichTextPlugin
|
<RichTextPlugin
|
||||||
contentEditable={
|
contentEditable={
|
||||||
<ContentEditable
|
<ContentEditable
|
||||||
|
id="custom-editor"
|
||||||
readOnly={!editable}
|
readOnly={!editable}
|
||||||
style={{ height: props.height }}
|
style={{ height: props.height }}
|
||||||
className="editor-input focus:outline-none"
|
className="editor-input focus:outline-none"
|
||||||
|
|||||||
Reference in new issue
Block a user