fix:Save card on lost focus if not empty#1151
Conversation
|
Please merge! 😬🙏 @mgmeyers |
|
Hi, I run into this daily. How can I help to get this merged, @mgmeyers? |
|
@codingseb - I'll test it on my vault and add the results in this comment today. That's the least thing I can do for helping on the robustness side. Let me know if you need a second pair of eyes for the rest of the process here. :) |
|
|
|
Sorry, @codingseb, but I actually found an issue here. So, the contents get preserved when I click somewhere else in the kanban. Which is great. However, it gets lost when I click a link and the tab loads the underlying markdown file. When I navigate back the card is not present. But, it is present when I click somewhere randomly else first - this actually happened by accident :-) but helped me to reproduce that. Note, that I have |
Implements a global save mechanism to persist edits before a Kanban view is closed or a tab is changed. This ensures no data loss by triggering a 'save-all-editing-items' event, which is listened for by both ItemContent and ItemForm components to save any pending changes.
|
Thanks @rscircus I added some triggers to save modifications and creations on :
That should handle more cases. |
|
main.js (obsolete corrected version for enabling menu items below) |
|
Hi! I just wanted to say I’m also running into this issue on a daily basis, so I’d really love to see this merged. Is there anything I can do to help move this forward — testing, reviewing, or providing additional feedback? Happy to contribute if it helps! |
|
Would really love to have this feature! It would also be nice to add a setting for this so that users who prefer to cancel changes aren't affected. |
|
I have been using the fixed version for a while now, and mostly everything works well (especially glad to not be losing progress/work anymore!!) I did notice that right click actions like spelling corrections do not work since any click closes and saves the note (see screen recording below) Obsidian_Z5hbAicuDv.mp4 |
Previously, clicking on menu elements (e.g., dropdowns, context menus) associated with an item could erroneously trigger the `useOnclickOutside` handler. This could lead to premature saving or cancellation of an item's editing state. By adding `menu` and `menu-item` to the `ignoreClass` list for the `useOnclickOutside` hook, these interactions are now correctly disregarded, ensuring a smoother user experience.
Thanks @NicholasDawson I didn't notice that. I added menu-items in exceptions for card validation. Here is the corrected compiled version |
Corrections
Correct #1149, #1123, #1091 and #1100 behavior.
New behaviors when click outside a new card:
New behavior when click outside a card in edition :
This should avoid a lot of frustration
Tests
I tested it on my vault and it works well.