Skip to content

fix: activate drag-drop popup tabs for both dock and map popup modes#6751

Open
meyerlor wants to merge 4 commits into3liz:masterfrom
meyerlor:fix/popup-dd-tab-switching
Open

fix: activate drag-drop popup tabs for both dock and map popup modes#6751
meyerlor wants to merge 4 commits into3liz:masterfrom
meyerlor:fix/popup-dd-tab-switching

Conversation

@meyerlor
Copy link
Copy Markdown
Collaborator

@meyerlor meyerlor commented Apr 17, 2026

Fixes #6749

When using drag-and-drop form layouts with multiple tabs, clicking a tab in the popup never switched the content. This affected both popup modes (dock and map overlay).

Two bugs in displayGetFeatureInfo in map.js:

  1. The tab click handler was placed inside the map popup (else) branch, but referenced popupContainerId which is null in that branch. The resulting selector #null a[data-toggle="tab"] matched nothing.
  2. The dock popup (if) branch had no tab handler at all. Both used $(this).tab('show') — the Bootstrap 4 jQuery plugin API, which is not available in Bootstrap 5.

To fix this:

  • Added a tab handler in the map popup branch using the correct container (liz_layer_popup_contentDiv)
  • Added a tab handler in the dock popup branch (popupcontent)
  • Replaced $(this).tab('show') with bootstrap.Tab.getOrCreateInstance(el).show() (Bootstrap 5 native API)

I tested it with a layer using a drag-and-drop form converted to HTML maptip layout with 3 tabs. All tabs now switch correctly in both dock and map popup modes.

A companion fix in the lizmap-plugin is also required to regenerate the maptip HTML: https://github.com/meyerlor/lizmap-plugin/tree/fix/popup-tab-switching-bootstrap5

Backport to 3.9

release_3_9 is on Bootstrap 2, so bootstrap.Tab.getOrCreateInstance() is not available. If this fix is backported to 3.9, replace the two Tab.getOrCreateInstance(el).show() calls with $(el).tab('show') (jQuery plugin API). The structural fix — correcting the container selectors and adding the missing dock handler applies unchanged.

meyerlor and others added 2 commits April 17, 2026 09:40
Fields configured with a CheckBox edit widget in QGIS previously
displayed their raw value ("Ja", "Nein", "true", "false", etc.) in the
feature popup, instead of mirroring the editing form's native checkbox.

This change covers two popup render paths:

* Auto popup (popupDefaultContent, popup_all_features_table):
  new jTpl modifier popupcheckbox is used in place of featurepopup;
  receives a per-layer map of CheckBox fields resolved from the QGIS
  project XML by WMSRequest::getCheckBoxFieldsForLayer.

* QGIS/form popup (popupSource=form|qgis):
  WMSRequest::applyCheckBoxesToFormPopup post-processes the form HTML
  returned by QGIS Server, replacing the text inside each
  <span id="dd_jforms_view_edition_FIELD" class="jforms-control-input">
  with a disabled <input type="checkbox"> when the field is a
  CheckBox widget.

Matching is lenient so the common real-world variants all render as
checkboxes: the configured CheckedState/UncheckedState, common boolean
representations (true/t/1/yes/on and false/f/0/no/off) for fields
stored as boolean, and null-like values ('', NULL, QGIS's '()') which
render as unchecked.

Fixes 3liz#6748
The tab handler used popupContainerId which is null in the map popup
branch, making the selector '#null a[data-toggle="tab"]' match nothing.
The dock popup branch had no tab handler at all.

Fix both cases by attaching click handlers after content is inserted,
using bootstrap.Tab.getOrCreateInstance() (Bootstrap 5 API) instead of
the removed jQuery .tab('show') plugin call.

Fixes 3liz#6749
@meyerlor meyerlor force-pushed the fix/popup-dd-tab-switching branch from ec7418b to b7c6ebd Compare April 20, 2026 15:58
@meyerlor meyerlor force-pushed the fix/popup-dd-tab-switching branch from 52b9ccb to 6cb4e5a Compare April 20, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tab in QGIS HTML maptip Popup are not active

1 participant