Add helper class to jQuery UI autocomplete widget

Created on 25 June 2024, 5 months ago
Updated 6 September 2024, 3 months ago

Problem/Motivation

Theming jQuery UI's autocomplete widget can be tricky -- I'd like to add a helper class that can be used by any theme to style the autocomplete widget.

Steps to reproduce

Configure the vertex_ai_search module with autocomplete settings turned on; you will get a default jQuery UI autocomplete widget that can be hard to apply CSS to.

Proposed resolution

Add a small js library in the module's libraries.yml file that contains the following:
$( "#edit-key" ).autocomplete( "widget" ).addClass("vais-autocomplete");

This way, custom styles can be added to the vais-autocomplete class from any theme to override autocomplete widget styles without causing regressions for other jQuery ui widgets that may be on the page.

✨ Feature request
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ari.saves New Mexico

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024