-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x]: Add new field modal is cut off #15852
Comments
Thanks for reporting that! Having the menu always shown below the button was an intentional choice, because otherwise it’s not possible to drag-n-drop the fields into place. But I suppose being able to see the menu at all is more important than being able to drag-n-drop. (It’s still possible to drag the field into the right position after you’ve selected it.) So just removed the “below the button only” mandate, and fixed the scrolling bug as well. |
Realized there’s an obvious solution to the drag-n-drop problem: we can just hide the menu as soon as you start dragging. Made that change as well. CleanShot.2024-10-08.at.09.31.01.mp4 |
Nice, that's a good solve for that 👍 |
Craft 4.12.6 and 5.4.7 are out with those changes. Thanks again! |
What happened?
Description
The add new field modal in the field layout view sits below the screen when you would expect it to show above the add new field button when it's located towards the bottom of the screen (if you're using Floating UI, it's the flip behavior). This makes it really difficult to use in some circumstances. This only applies to when you're editing an entry type in the drawer view.
In addition, the modal doesn't reposition when you scroll, so it's always stuck in the same position.
I would recommend using the Floating UI library. This is what Radix UI uses under the hood (there's a Vue port as well).
Steps to reproduce
Expected behavior
The modal should reposition so that it anchors with the add new field button and flips based on which side would better fit the modal contents.
Actual behavior
The modal gets cut off and/or doesn't reposition when you scroll.
Craft CMS version
5.4.4
PHP version
8.2.23
Operating system and version
Linux 6.5.11-linuxkit
Database type and version
MySQL 8.0.37
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.1-32)
Installed plugins and versions
The text was updated successfully, but these errors were encountered: