react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Fixed menu position based on scrollable parent

Open prateekgarcha opened this issue 6 years ago • 7 comments

This fixes 3822, as previously the positioning of the menu was based on the window height and the menu was being truncated if it could fit inside the window but not the scrollable parent. But now, the position will be based on the height and boundaries of the closest scrollable parent element, like in the case of a slide panel or a dialog box, where the panel/dialog can be placed anywhere in the window which limits the area where the menu can be viewed.

-----UPDATE----- The scrollable parent must have a 'non-static' (or default) position in order for this fix to work. Ideally, position: relative would be enough for most cases but can be anything other than static.

prateekgarcha avatar Oct 24 '19 20:10 prateekgarcha

🦋 Changeset is good to go

Latest commit: 12a174442939e931b28f4f6ecd65e95dd998b133

We got this.

This PR includes changesets to release 2 packages
Name Type
react-select Major
@react-select/docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Oct 24 '19 20:10 changeset-bot[bot]

@charrondev yeah I forgot to mention that we have to add position: relative to the parent. I too had to use this in order to fix the issue on my end as well. I've updated the description now as well.

I'll try to update the logic of getScrollParent and update you when it's done.

prateekgarcha avatar Nov 04 '19 16:11 prateekgarcha

@charrondev I've added the changes to getScrollParent. Let me know if anything else needs to be changed.

prateekgarcha avatar Nov 04 '19 21:11 prateekgarcha

I also opened a PR with a fix and tests for this issue months ago, and it got no attention from the maintainers. I'd be curious to compare our two approaches, but I don't really have the time or energy right now. https://github.com/JedWatson/react-select/pull/3669

IanVS avatar Nov 22 '19 16:11 IanVS

If @JedWatson is unavailable is there another active maintainer that could take a look at this? Going by the commits, the next person seems to be @gwyneplaine

charrondev avatar Nov 25 '19 15:11 charrondev

@flexdinesh I saw that you have started to look into stuff in this repo, so, whenever you get some time, can you please take a look at this PR or ask someone else to merge this? Would really appreciate your help. Thanks!

prateekgarcha avatar Mar 06 '20 21:03 prateekgarcha

The branch contains conflicts, if some with write access could help here. (This is a very old PR but the content seems relevant)

htech9 avatar Dec 31 '24 06:12 htech9