Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): Save step template form on unmount to handle esc key #7444

Conversation

desiprisg
Copy link
Contributor

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Jan 7, 2025

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 39a389a
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/677d0613b7f14c00086c3530
😎 Deploy Preview https://deploy-preview-7444.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit 39a389a
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/677d061339011500080a4511
😎 Deploy Preview https://deploy-preview-7444.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines 66 to 73
const saveFormRef = useRef(saveForm);
useEffect(() => {
saveFormRef.current = saveForm;
}, [saveForm]);
useEffect(() => {
return () => {
saveFormRef.current();
};
}, [saveFormRef]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const saveFormRef = useRef(saveForm);
useEffect(() => {
saveFormRef.current = saveForm;
}, [saveForm]);
useEffect(() => {
return () => {
saveFormRef.current();
};
}, [saveFormRef]);
const saveFormRef = useDataRef(saveForm);
useEffect(() => {
return () => {
saveFormRef.current();
};
}, [saveFormRef]);

@desiprisg desiprisg force-pushed the nv-4952-polishdashboard-editor-missing-save-on-escape-button-click branch from 115aeff to 39a389a Compare January 7, 2025 10:46
@desiprisg desiprisg merged commit 6606f6e into next Jan 7, 2025
34 checks passed
@desiprisg desiprisg deleted the nv-4952-polishdashboard-editor-missing-save-on-escape-button-click branch January 7, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants