Here's the scenario I'm facing:
I have rows with buttons that, when clicked, reveal a set of options. The challenge is that depending on where the row is located on the page, the settings need to open either above or below the button. When the button is at the top of the page, the settings should display beneath it. Conversely, if the button is at the bottom of the page, the settings should open above it.
Furthermore, if a user selects an option at the bottom of the page and then scrolls up towards the top, the settings should follow under the button rather than staying on top. I'm unsure about the best approach to achieve this functionality and would appreciate any advice you can provide.