Hello Tasha,
Thank you for your previous response; I appreciate the clarification about using the init handler. With this approach, my custom editor opens correctly the first time. However, I’m still experiencing an issue where the default editor reappears after closing my custom editor and double-clicking a task again.
To make things clearer, I’ve recorded a short video demonstrating the behavior: https://imgur.com/a/IgHTQ9I.
Here’s the code I’m currently using:
const apiRef = createRef();
useEffect(() => {
if (apiRef.current && api) {
const current = apiRef.current;
if (api.onShowEditor) {
current.intercept("show-editor", api.onShowEditor);
}
}
}, []);
return (
<Gantt
init={(api: any) => (apiRef.current = api)}
readonly={readonly}
tasks={tasks}
setTasks={setTasks}
links={links}
scales={scales}
/>
);
The api.onShowEditor callback works as expected and has been thoroughly tested. However, I suspect there might be an issue with how the intercept is applied after the first execution. I’ve already tried detaching and re-registering the intercept within the callback, but that hasn’t resolved the issue.
Could you let me know if there’s something I’ve misunderstood in my implementation or if there’s a better way to ensure the intercept consistently overrides the default editor?
Thank you in advance for your help!