1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-03 06:12:53 +02:00

Fix focus issue on persona form

This commit is contained in:
Kamran Ahmed
2025-06-10 14:02:25 +01:00
parent cca2c1bd36
commit 7fa372141d

View File

@@ -168,20 +168,16 @@ export function RoadmapFloatingChat(props: RoadmapChatProps) {
// it means user came back to the AI chat from the topic detail
const handleCloseTopicDetail = () => {
lockBodyScroll(isOpen);
setTimeout(() => {
inputRef.current?.focus();
}, 0);
};
window.addEventListener(CLOSE_TOPIC_DETAIL_EVENT, handleCloseTopicDetail);
return () => {
console.log('remove event listener');
window.removeEventListener(
CLOSE_TOPIC_DETAIL_EVENT,
handleCloseTopicDetail,
);
};
}, [isOpen]);
}, [isOpen, isPersonalizeOpen]);
function textToJSON(text: string): JSONContent {
return {