🐛 Fix: Change Dates Using Keyboard and DatePicker#287
Merged
tyler-dane merged 13 commits intomainfrom Mar 6, 2025
Merged
Conversation
Focus Trap was preventing the date picker's keyboard events from being captured.
Removed unnecessary dependencies related to focus-trap, eslint-plugin-import, and other unused packages to clean up project dependencies.
- Remove index files for DatePicker and Input components - Update import paths for DatePicker and Input - Modify Focusable component to use setIsFocused instead of toggleFocused - Adjust DatePicker input to use StyledInput
When changing a date and then changing another form field (like title), the date change was being lost. This makes sure that everytime the date is changed, the draft is updated.
Tracking these separately makes it possible to display user-friendly dates, while also letting the date picker and backend use backend-friendly dates, which save an all-day event like so: start: 2025-03-03, end 2025-03-04
remove unnecessary adjustComplimentDateIfNeeded, preferring to do this logic on the onSelect handlers
Modify event form field update logic to use a more concise and consistent approach: - Simplify onSetEventField to accept a partial event object - Update type definitions to match new implementation - Adjust event field updates across multiple components to use new method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #232
a11ydemo.mov
This pull request includes several changes to the
packages/webdirectory, focusing on refactoring date and time utilities, updating components, and improving the event form's date handling. The most important changes include renaming and refactoring utility functions, updating theDatePickercomponent, and enhancing the event form's date handling logic.Refactoring date and time utilities:
date.utiltodatetime.utiland moved relevant functions (shouldAdjustComplimentDate,shouldAdjustComplimentTime) toweb.datetime.util.tsto better organize date and time utilities. [1] [2]Updating components:
InputwithStyledInputin theDatePickercomponent and added a default value forbgColor. [1] [2] [3] [4]DatePickerandInputcomponent files. [1] [2]Enhancing event form's date handling:
DatePickerscomponent to handle date adjustments more effectively, ensuring the end date is correctly set when the start date changes and vice versa. [1] [2] [3]displayEndDateandonSetEventFieldprops toDatePickersto manage the display and backend date formats properly. [1] [2]Minor changes:
focus-trap-reactfrompackage.jsondependencies.Focusablecomponent to improve type safety. [1] [2]