ng-select / ng-select

:star: Native angular select component
https://ng-select.github.io/ng-select/
MIT License
3.28k stars 907 forks source link

Dropdown doesn't adjust its position (top or bottom) when the options change due to a typeahead #2092

Open siovene opened 2 years ago

siovene commented 2 years ago

Describe the bug In case of dynamically populate options (typeahead), the position of the dropdown (top or bottom) is not updated when the items change.

To Reproduce

  1. Create a page with an ng-select that's at the bottom of the page
  2. Set dropdownPosition to 'auto'
  3. Set a typeahead and type something that results in only a few options, so that they fit when the dropdown opens at the bottom.
  4. Now type something that results in a lot of options, so that the "bottom" position is not suitable anymore.

Expected behavior I expect the dropdown to adjust it's position when the option items change, but it doesn't.

My workaround is the following, tapping into the typeahead:

setTimeout(() => {
    (this._ngSelect.dropdownPanel as any)._handleDropdownPosition();
}, 1);

But it's not nice because it depends on a private method.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 2 years ago

Might be stale because the project owner hasn't addressed it, but it's an issue nonetheless. I recommend disabling this bot if this project is abandoned.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 1 year ago

.

fexxdev commented 1 year ago

It's happening here aswell

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 1 year ago

Might be stale because the project owner hasn't addressed it, but it's an issue nonetheless. I recommend disabling this bot if this project is abandoned.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 1 year ago

🏓

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 1 year ago

🏓

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 1 year ago

🏓

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 1 year ago

🏓

fexxdev commented 1 year ago

up!

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 10 months ago

🏓

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 8 months ago

🏓

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 6 months ago

🏓

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks:

siovene commented 4 months ago

🏓

pavankjadda commented 4 months ago

@siovene care to contribute?

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions :fireworks: