My older site uses bootstrap 3 and has been working great when accessed from a mobile phone and the hamburger menu kicks in, but something has happened in jQuery 3.6.2 (In Drupal 9.5.0) that causes the menu click to fire and then immediately close the menu. I can see this when setting breakpoints in the Drupal behaviors script. Looks like some kind of race condition. How would I lock down the child theme to use only jQuery 3.6.0? Most of what is on Drupal site about using different libraries is old or the code does not work at all.
I've tried the suggestion below and jQuery never loads in the theme. I could see it core/assets/vendor folder when not overridden.
name: Visitor Permits
type: theme
core_version_requirement: ^8 || ^9
description: Child theme for Visitor Permits.
base theme: bootstrap
screenshot: profile-vpermits.jpg
# Libraries
libraries:
- vpermits/vpermits
libraries-override:
core/jquery: vpermits/jquery
# Regions
regions:
mobile: "Mobile"
header_left: "Header Left"
header_right: "Header Right"
navigation: "Navigation"
sidebar_left: "Sidebar Left"
content: "Content"
sidebar_right: "Sidebar Right"
footer: "Footer"
disabled: "Disabled"
And the .libraries.yml
vpermits:
version: VERSION
js:
dist/vpermits.js: {}
css:
theme:
dist/style.css: {}
dependencies:
- core/drupal
- core/modernizr
- vpermits/babel-polyfill
- core/drupal.dialog.ajax
- core/jquery.form
permit-form-app:
version: 1.x
js:
dist/permit-form-app.js: {}
css:
theme:
dist/app-style.css: {}
dependencies:
- vpermits/babel-polyfill
babel-polyfill:
version: 1.x
js:
dist/polyfill.js: {}
jquery:
remote: https://github.com/jquery/jquery
version: "3.6.0"
license:
name: MIT
url: https://raw.githubusercontent.com/jquery/jquery/3.6.0/LICENSE.txt
gpl-compatible: true
js:
assets/vendor/jquery/jquery.min.js: { minified: true, weight: -20 }