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

It is need to know when menu will be rendered and had position

Open Viktor-the-great opened this issue 5 years ago • 5 comments
trafficstars

first of all sorry for my english

Input field is inside menu (Dropdown.Menu). There is a lot of text in front of the input field. Set focus on input field when menu is mounted. Menu has not yet received a position, so the page is scroll to the beginning (menu is hidden and is at the very top of the page).

I am now using timeout to fix it. In demo scroll to bottom. There are two input button to open dropdown. Page scrolls up when first button is pressed. Second button use setTimeout to wait when menu get position.

I suggest using onCreate, onUpdate of Popper.js to solve this problem, and for this to pass these functions to the constructor (usePopper hook)

Viktor-the-great avatar Dec 09 '19 15:12 Viktor-the-great

Pass in popperConfig to set detailed Popper options

taion avatar Dec 09 '19 19:12 taion

Pass in popperConfig to set detailed Popper options

I see only popperConfig.modifiers https://github.com/react-bootstrap/react-overlays/blob/3db0db2b569f86e71c42a0597a1973e8f58144d3/src/DropdownMenu.js#L42-L55 PopperJS accept: Снимок экрана от 2019-12-10 01-15-37

Viktor-the-great avatar Dec 09 '19 22:12 Viktor-the-great

ah, okay. this should spread in ...popperConfig as with <Overlay> then. can you send in a PR?

taion avatar Dec 09 '19 22:12 taion

yes I can

Viktor-the-great avatar Dec 09 '19 22:12 Viktor-the-great

thanks!

taion avatar Dec 09 '19 22:12 taion