Skip to content

Commit

Permalink
revert remove dropdown properties on show dropdown false
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerwyn committed Nov 21, 2024
1 parent f2dab7c commit 4a4593a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/custom-features-row.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions src/classes/custom-feature-dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ export class CustomFeatureDropdown extends BaseCustomFeature {
const dropdown = this.shadowRoot?.querySelector(
'.dropdown',
) as HTMLElement;
dropdown.style.removeProperty('left');
dropdown.style.removeProperty('top');
dropdown.style.removeProperty('bottom');
dropdown.style.removeProperty('max-height');
dropdown.style.removeProperty('overflow-y');

if (this.showDropdown) {
const rect = this.getBoundingClientRect();
const edgeOffset = 48;
Expand All @@ -173,6 +169,14 @@ export class CustomFeatureDropdown extends BaseCustomFeature {
`${window.innerHeight - rect.bottom - edgeOffset}px`,
);
dropdown.style.setProperty('overflow-y', 'scroll');
} else {
setTimeout(() => {
dropdown.style.removeProperty('left');
dropdown.style.removeProperty('top');
dropdown.style.removeProperty('bottom');
dropdown.style.removeProperty('max-height');
dropdown.style.removeProperty('overflow-y');
}, 150);
}
}

Expand Down

0 comments on commit 4a4593a

Please sign in to comment.