Field autocomplete widget add scrollbar

Created on 11 April 2024, 7 months ago

Field autocomplete widget add scrollbar

login as admin or user with permission to create content. If you use field of type entity reference with autocomplete, you can configure the number of elements to display, but when number of items too large(in our case this is 100) to display and the list of results become too long and this is doesn't comfortable for the content managers.

Add some styles to add scroll bar of default 10 items and other can be scrolled

PHP 8.1, Drupal 10.2.5.

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇺🇦Ukraine Vadym.Tseiko

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Vadym.Tseiko
  • 🇺🇦Ukraine Vadym.Tseiko

    Forgot to mention - we use the gin admin theme version 3.0.0-rc9. Also added a patch that adds a scrollbar.

  • First commit to issue fork.
  • Merge request !406fixed field autocomplete widget → (Open) created by Unnamed author
  • Status changed to Needs review 7 months ago
  • 🇮🇳India sarwan_verma

    Hi @Vadym.Tseiko, @saschaeggi,
    Fix the issue and created MR. please review it once.

  • Pipeline finished with Failed
    7 months ago
    Total: 214s
    #143970
  • Status changed to Needs work 7 months ago
  • 🇮🇳India Nupur Badola

    Scroller is added but not able to view all the tags in that autocomplete field. Unable to scroll till the end.

  • Assigned to Salman_innoraft
  • Issue was unassigned.
  • Not able to reproduce the issue.
    I can only see 10 default suggestions for the autocomplete field and this is the default behaviour of any drupal theme.
    Attaching the screenshot for the same.
    Please provide some more details for reproducing the issue.

  • Unable to reproduce

    step followed :
    create a entity reference field with unlimited values.

    but after 10 result no other results are visible.

  • Hi @vadym.tseiko,
    I have checked #2 patch and its working fine at my end. I am also attached the screen-shot for references.

    +RTBC Done

    Also, @saurav-drupal-dev and @nupur badola
    If you need more than 10 result than kindly follow below steps.

    - Navigate to Manage form display for your content type.
    - Click on the gear icon next to your entity reference field to edit its settings.
    - Check if there are any options for controlling the autocomplete behavior or limiting the number of results.
    - Set here maximum number here and save.
    - Edit your content and type the text and see there autocomplete result will more than 10.

  • 🇨🇭Switzerland saschaeggi Zurich

    Hey 👋

    I left some comments in the code. Also note that the source files are missing, so moving this back to needs work

    I wonder if we better fix this in Core instead of here so other themes can benefit of this, too.

Production build 0.71.5 2024