fix(DateTimePicker): scope the panel's layout to the panel, not to the field - #703
Merged
Merged
Conversation
…e field `.date-time-picker .date-picker-timepickers` and the time tokens it needs sat under the field's root, so they stopped applying the moment the panel left it — which `container` does by teleporting, and which a framework port does by default when it renders the panel through a portal. The calendar and the time body then stacked instead of sitting side by side, and the columns lost the `--cui-time-picker-*` properties that size them. The panel already owns its tokens for this exact reason (see `.date-picker-popup` in this file). These two blocks move onto it as well. The scope stays exact: `.date-picker-timepickers` and a `.time-picker-body` inside a date picker panel exist only in the date-time picker.
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.
.date-time-picker .date-picker-timepickersand the--cui-time-picker-*properties the time body needs sat under the field's root, so they stop applying the moment the panel leaves it — whichcontainerdoes by teleporting it, and which a framework port does by default when it renders the panel through a portal.The result: the calendar and the time body stack instead of sitting side by side, and the columns lose the properties that size them. Measured in the React port, whose panel is portaled by default: the panel went 1442 px tall (five columns stacked) instead of 388 px.
The panel already owns its tokens for exactly this reason — the comment above
.date-picker-popupin this file spells it out. These two blocks move onto it as well. The scope stays exact: a.date-picker-timepickers, and a.time-picker-bodyinside a date picker panel, exist only in the date-time picker.Found while porting the v2 pickers to React (coreui-react-pro#83).