Skip to content
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

fix(components): fix setting contentDensity styles #2094

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

ilhan007
Copy link
Member

Fixes
TimePicker was never considering contentDensity and did not update the styles of its popover so far.
DatePicker and DateTimePicker used to call updateStaticAreaItemContentDensity before the staticAreaItem DOM is available.
Solution:
Handle setting the contentDensity on framework level when possible and remove updateStaticAreaItemContentDensity calls from ShellBar, ComboBox, Select, Input, MultiCombobox. The updateStaticAreaItemContentDensity method exists and used in the TabContainer only, because the component does not invalidate on overflow popover open/close and needs to force the contentDensity update.

FIXES #2093

Fixes
- TimePicker was never considering contentDensity
- DatePicker and DateTimePicker used to call updateStaticAreaItemContentDensity before the staticAreaItemDom is available

Solution:
handle setting of contentDensity on framework level when possible and remove updateStaticAreaItemContentDensity calls from ShellBar, ComboBox, Select, Input, MultiCombobox. The updateStaticAreaItemContentDensity method exists and used in the TabContainer only, because the component does not invalidate on open/close of the overflow and needs to force the contentDensity update.
Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should have been like that from the start. I don't see any downsides to this solution.

I remember vaguely we discussed this and decided to do it for each component separately before opening their static area popups. Do you remember if there was any reason?

Otherwise, +1 from me

@ilhan007
Copy link
Member Author

I think it should have been like that from the start. I don't see any downsides to this solution.

I remember vaguely we discussed this and decided to do it for each component separately before opening their static area popups. Do you remember if there was any reason?

Otherwise, +1 from me

No, unfortunately I can't remember

@ilhan007 ilhan007 merged commit 9454ab7 into master Aug 17, 2020
@ilhan007 ilhan007 deleted the fix-contentDensity-apply branch August 17, 2020 08:06
ilhan007 added a commit that referenced this pull request Nov 11, 2020
Fixes
TimePicker was never considering contentDensity and did not update the styles of its popover so far.
DatePicker and DateTimePicker used to call updateStaticAreaItemContentDensity before the staticAreaItem DOM is available.
Solution:
Handle setting the contentDensity on framework level when possible and remove updateStaticAreaItemContentDensity calls from ShellBar, ComboBox, Select, Input, MultiCombobox. The updateStaticAreaItemContentDensity method exists and used in the TabContainer only, because the component does not invalidate on overflow popover open/close and needs to force the contentDensity update.

FIXES #2093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date & Time picker components have inconsistent view in Compact size
2 participants