mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-03 14:22:41 +02:00
Fix focus issue on persona form
This commit is contained in:
@@ -168,20 +168,16 @@ export function RoadmapFloatingChat(props: RoadmapChatProps) {
|
|||||||
// it means user came back to the AI chat from the topic detail
|
// it means user came back to the AI chat from the topic detail
|
||||||
const handleCloseTopicDetail = () => {
|
const handleCloseTopicDetail = () => {
|
||||||
lockBodyScroll(isOpen);
|
lockBodyScroll(isOpen);
|
||||||
setTimeout(() => {
|
|
||||||
inputRef.current?.focus();
|
|
||||||
}, 0);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener(CLOSE_TOPIC_DETAIL_EVENT, handleCloseTopicDetail);
|
window.addEventListener(CLOSE_TOPIC_DETAIL_EVENT, handleCloseTopicDetail);
|
||||||
return () => {
|
return () => {
|
||||||
console.log('remove event listener');
|
|
||||||
window.removeEventListener(
|
window.removeEventListener(
|
||||||
CLOSE_TOPIC_DETAIL_EVENT,
|
CLOSE_TOPIC_DETAIL_EVENT,
|
||||||
handleCloseTopicDetail,
|
handleCloseTopicDetail,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}, [isOpen]);
|
}, [isOpen, isPersonalizeOpen]);
|
||||||
|
|
||||||
function textToJSON(text: string): JSONContent {
|
function textToJSON(text: string): JSONContent {
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user