stimulus-dropdown icon indicating copy to clipboard operation
stimulus-dropdown copied to clipboard

Prevent dropdown menu outside the screen

Open AxelBriche opened this issue 1 year ago • 5 comments

Prevents the menu from leaving the screen, so that it always remains visible.

This also allows the menu to be used in the navigation bars at the bottom of the screen, with the menu displayed at the top and not off the screen, simplifying responsiveness and preventing unwanted behavior.

Video: Test on preview url: https://share.cleanshot.com/kqJLh2NR

AxelBriche avatar Mar 21 '23 10:03 AxelBriche

Deploy Preview for stimulus-dropdown ready!

Name Link
Latest commit 4116ac64e3d1224c98421a7364318c31d4b143ee
Latest deploy log https://app.netlify.com/sites/stimulus-dropdown/deploys/642b47d7ffd6fd000883ba9f
Deploy Preview https://deploy-preview-9--stimulus-dropdown.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Mar 21 '23 10:03 netlify[bot]

This is a good idea! Thanks a lot

But this PR seems to be really tied to Tailwind syntax and not really customizable. I'll do some tests on my side and you can try to update the PR in the meantime 👍

guillaumebriday avatar Mar 29 '23 02:03 guillaumebriday

Everything is done on the controller side, you can refer to my last two commit names for more information on the latest updates.

AxelBriche avatar Apr 03 '23 21:04 AxelBriche

Up

AxelBriche avatar Jul 25 '23 08:07 AxelBriche

hi, thanks for the PR!

But I don't really like the approach with the style customization. It seems to be too specific and not a generic solution.

In my project, I just changed the CSS of the dropdown so it opens in the other direction and it works well. I'm not sure it worth all this changes to fix the issue though

guillaumebriday avatar Aug 09 '23 02:08 guillaumebriday