Problem/motivation

When Linkit is used with the Gin admin theme, the vertical scrollbar does not work when the widget is used for a node field URL link outside of CKEditor.
The CSS is currently written specifically for CKEditor, so it is not applied when the module is used for a node field URL link.

Steps to reproduce

  1. Create a new link field in the node
  2. Set the linkit widget for that field in the manage form display
  3. Create a node and type the string in URL field.

Solution

Add CSS

overflow: auto;
  max-height: calc((100vh - 80px) / 2);

in .linkit-ui-autocomplete.ui-widget in the file css/linkit.autocomplete.css

Issue fork linkit-3595747

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

keshavv created an issue. See original summary.

keshavv’s picture

Issue summary: View changes
keshavv’s picture

Issue summary: View changes
keshavv’s picture

Version: 7.1.x-dev » 7.x-dev
keshavv’s picture

Issue summary: View changes
keshavv’s picture

StatusFileSize
new382 bytes
dkmishra’s picture

@keshavv, I tested the patch and the issue appears to be resolved.

Environment used for testing:

- Theme: Gin
- Drupal: 11.3.11
- PHP: 8.3
- Linkit: 7.0.15

I've attached screenshots for reference.

dkmishra’s picture

Hi @keshavv, it would be great if you could create a merge request for this patch.

debdeep.mukhopadhyay made their first commit to this issue’s fork.

debdeep.mukhopadhyay’s picture

Hi @keshav @dkmishra ,

I also tested the patch on my local and it works as expected. The vertical scrolling issue is resolved after applying the fix. Thanks for the patch.

I have created a merge request for review.

Thanks

dkmishra’s picture

Status: Active » Reviewed & tested by the community
drumanuel’s picture

StatusFileSize
new2.92 KB

I've added a flip/height calculation as for me, the autocomplete lives at the bottom of the page. (100vh - 80px) / 2 was still causing it to go off screen.

drumanuel’s picture

StatusFileSize
new2.91 KB

updated version of the my patch. Patches version 7.0.15

drumanuel’s picture

dkmishra’s picture

Status: Reviewed & tested by the community » Needs review

Hi @drumanuel, thanks for pointing this out and for providing the additional fix. We'll take another look at the issue and review the updated approach. Your feedback about the height calculation and the autocomplete positioning at the bottom of the page is very helpful.

dkmishra’s picture

StatusFileSize
new70.59 KB
new65.82 KB

Patch #14 introduces a UI regression. Previously, the autocomplete dropdown had sufficient spacing below it. After applying this patch, it expands to the bottom of the viewport and nearly touches the screen edge.

Additionally, the JavaScript viewport calculation and menu repositioning changes appear to be outside the scope of this issue.

I recommend proceeding with the smaller CSS-only approach from patch #6 instead.

For reference, I have attached screenshots.

drumanuel’s picture

StatusFileSize
new208.34 KB

Just some extra info:

I have an entity reference field in a modal at the bottom of the form (a paragraph form in layout paragraphs). Because there is no scrollbar the contents falls outside of the screen, unreachable for the user. The (100vh - 80px) / 2 does not fix this. I've added a screenshot.

You want another ticket for this?