mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Added in the toggle so when blurring from reply textbox it'll undo the reply button too
refs https://github.com/TryGhost/Team/issues/1703
This commit is contained in:
parent
5466ca2608
commit
b60f0995d9
@ -80,7 +80,7 @@ const Comment = (props) => {
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<div className="ml-14 my-10">
|
||||
<Form parent={comment} toggle={toggleReplyMode} isReply={true} />
|
||||
<Form parent={comment} toggle={toggleReplyMode} isReply={true} toggleReplyMode={toggleReplyMode} />
|
||||
</div>
|
||||
</Transition>
|
||||
</>
|
||||
|
@ -35,11 +35,6 @@ const Form = (props) => {
|
||||
...getEditorConfig(config)
|
||||
});
|
||||
|
||||
// const isInViewport = () => {
|
||||
// const top = formEl.current.getBoundingClientRect().top;
|
||||
// return (top >= 0 && top <= window.innerHeight);
|
||||
// };
|
||||
|
||||
const getScrollToPosition = () => {
|
||||
let yOffset = -100;
|
||||
const element = formEl.current;
|
||||
@ -86,9 +81,12 @@ const Form = (props) => {
|
||||
}, 100);
|
||||
}
|
||||
|
||||
editor.on('blur', (editorObj) => {
|
||||
editor.on('blur', () => {
|
||||
if (editor?.isEmpty) {
|
||||
setFormOpen(false);
|
||||
if (props.isReply && props.toggleReplyMode) {
|
||||
props.toggleReplyMode();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -108,7 +106,7 @@ const Form = (props) => {
|
||||
});
|
||||
})
|
||||
.run();
|
||||
}, [editor, props.isEdit, props.isReply, formEl]);
|
||||
}, [editor, props, props.isEdit, props.isReply, props.toggleReplyMode]);
|
||||
|
||||
const submitForm = async (event) => {
|
||||
event.preventDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user