Skip to content

feat: fix filter sizing - #7653

Open
GZolla wants to merge 1 commit into
mainfrom
gzolla/dropdown-sizing
Open

GZolla wants to merge 1 commit into
mainfrom
gzolla/dropdown-sizing

Conversation

@GZolla

@GZolla GZolla commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-7653/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

@GZolla
GZolla marked this pull request as ready for review October 26, 2026 16:35
@GZolla
GZolla requested a review from a team as a code owner October 26, 2026 16:35
}

this.position(e.detail, { updateLocation: this.#initializingHeight });
this.position(undefined, { updateLocation: this.#initializingHeight });

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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-menu size === d2l-menu size. This e.detail was meant to be an optimization so that the positioning logic would not have to measure it.

this._closeRadio = false;

const menu = this.#getMenuElement();
menu.resize();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Curious why this is no longer needed... ?

* Whether the dropdown opens above the opener
* @type {boolean}
*/
openAbove: { type: Boolean, attribute: 'open-above' },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is meant to give consumers the ability to force it to open upwards, even if there's enough space below? Is this needed to address the issue - given the fix to the calculation, wouldn't the dropdown now open upwards if there isn't enough space below?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah I'm hesitant to force open-above, since there could be cases where there's less space above than below.

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.

3 participants