-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add basic text editor using textarea #107
base: main
Are you sure you want to change the base?
Conversation
I am not sure if this is the right UX pattern as we don't have an example of an editor anywhere in Cockpit, but it might be worth it to add a beforeunload event so when a user accidently closes the tab they get a warning. @garrett |
Yes, set this in an onChange event (so it will only block when the content has changed) and make sure it's unset when the modal is dismissed with an action (save, cancel). In other words, if nothing has changed in the textarea (or if it was saved or discarded), then it shouldn't block closing the page. But if something was changed, then block the page. |
8559b25
to
81d4754
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - I like it much more.
b566751
to
a6581ce
Compare
Using |
c293da2
to
b7013cc
Compare
b7013cc
to
f1c2c93
Compare
f1c2c93
to
dcbba0b
Compare
To make it clear what I was thinking about, I've included a design @ #63:
|
I wouldn't over-engineer this. |
Context menu breaks after closing the editor, either after 'save' or 'cancel'. After changing directory it works normally until the page is refreshed