Update the date and time when pressing Alt+Enter or Page Up/Down in edit widget #1346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to fix issues #1274 and #1345
The keypress methods in DateTimeWidget and ValidatedEdit did not account for leaving the field by pressing page up/down or meta+enter. I've added these.
Also, the keypress method of EventEditor did not propagate a keypress of 'meta enter' to its children (i.e. the time and date fields). Therefore, they were not able to update the event before the EventEditor closed. I've changed the order of the calls. I'm not 100% confident about my understanding of urwid keypress hierarchy, so I've made the conservative choice to save the return value of
super().keypress(size, key)
and return that after saving (i.e. where it originally was).The reference to 'meta enter' should probably be replaced by referring to the proper keybinding, but I'm not entirely sure how those work.