Repository navigation
feat: fix filter sizing #7653
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
base: main
Are you sure you want to change the base?
feat: fix filter sizing #7653
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,15 +125,15 @@ class DropdownMenu extends ThemeMixin(DropdownPopoverMixin(LitElement)) { | |
| this.#getMenuElement().focus(); | ||
| } | ||
|
|
||
| #handleMenuResize(e) { | ||
| #handleMenuResize() { | ||
|
|
||
| if (this._mobile && this.mobileTray) { | ||
| this.maxHeight = null; | ||
| } else { | ||
| this.maxHeight = this.#maxHeightNonTray; | ||
| } | ||
|
|
||
| this.position(e.detail, { updateLocation: this.#initializingHeight }); | ||
| this.position(undefined, { updateLocation: this.#initializingHeight }); | ||
| this.#initializingHeight = false; | ||
|
|
||
| const menu = this.#getMenuElement(); | ||
|
|
@@ -152,7 +152,6 @@ class DropdownMenu extends ThemeMixin(DropdownPopoverMixin(LitElement)) { | |
| this._closeRadio = false; | ||
|
|
||
| const menu = this.#getMenuElement(); | ||
| menu.resize(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious why this is no longer needed... ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome. Thanks. That might have been something that was previously needed before native |
||
|
|
||
| // If dropdown-menu is opened on first render, do not focus | ||
| if (this.#initiallyOpenedSuppressFocus) this.#initiallyOpenedSuppressFocus = false; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handler was using the menu content rect to calculate positioning. This changes it so it uses the whole filter dropdown instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I think the original assumption, before filter and a header was introduced, was that
d2l-dropdown-menusize ===d2l-menusize. Thise.detailwas meant to be an optimization so that the positioning logic would not have to measure it.