Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Button onclick Event Not Triggering in Popups #4914

Closed
1 task
aaronlaver opened this issue Oct 23, 2024 · 1 comment
Closed
1 task

[Bug]: Button onclick Event Not Triggering in Popups #4914

aaronlaver opened this issue Oct 23, 2024 · 1 comment
Labels

Comments

@aaronlaver
Copy link

What is the bug? (in English)

When using Lizmap version 3.8.2 (Docker tag 3.8), the onclick event for buttons embedded in HTML popups does not trigger as expected. Despite proper rendering of the buttons and JavaScript code, the events are never fired, and no network requests are initiated. The issue was confirmed to be tied to this specific Lizmap version, as downgrading or upgrading resolved the problem.

Expected Behavior:
The onclick event should trigger the associated JavaScript function when the button is clicked, making the corresponding network request or handling the event.

Actual Behavior:
The button appears, but clicking it does not trigger any associated action, and no JavaScript function is called.

Workaround:
Downgrading to Lizmap 3.7.11 (Docker 3.7) resolves the issue.

Additional Information:
Logs or console output may not provide useful information as the JavaScript function is not triggered at all. The issue seems confined to the specific version of Lizmap.

Steps to reproduce the issue

Create a popup with a button using the onclick attribute in a Lizmap project.
Bind the onclick event to a JavaScript function (e.g., triggering a fetch request).
Load the project and try to click the button.
Observe that no action is taken, and no JavaScript function is triggered.

Versions, safeguards, check summary etc

Environment:
Lizmap version: 3.8.2
Browser: Chrome/Firefox/Edge
QGIS version: 3.34.11

Check Lizmap plugin

  • I have done the step just before in the Lizmap QGIS desktop plugin before opening this ticket. Otherwise, my ticket is not considered valid and might get closed.

Operating system

Debian 11 Bullseye

Browsers

Firefox, Chrome, Microsoft Edge

Browsers version

Chrome: Version 129.0.6668.101 (Official Build) (64-bit)

Relevant log output

No response

@aaronlaver aaronlaver added the bug label Oct 23, 2024
@Gustry
Copy link
Member

Gustry commented Oct 24, 2024

Javascript inside a popup is not possible, due to XSS security issue.
You must use Javascript signals.
Duplicate of #4707

@Gustry Gustry closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants