You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
An issue with DocumentHandler buttons in infoclick was just discovered. As of #1252, Hajk listens to change of the query string parameter of URL (everything after #). If that string changes, Hajk acts upon those changes (see #1252 for a list of parameters it looks for).
Now, DocumentHandler can produce infoclick buttons using the {foobar}@@documenthandler notation.
The problem is that currently the HTML element produced by this function is an anchor with a href value of "#". Clicking such a button changes the value of the query string, which in turns leads to new params being parsed by Hajk as of #1252.
But since the string is empty and it specifically lacks the m parameter, Hajk interprets this as a change of map from whatever the current value is to the default one.
Since a change of map config involves app reload, this is what happens:
Skarminspelning.2023-06-05.kl.14.59.10.mov
A better behaviour would be something like this:
Skarminspelning.2023-06-05.kl.14.58.42.mov
There's a small detail though: we don't want to change from A to BUTTON, since they render differently.
This portion of code looks a bit funny too:
We want to render a BUTTON when not printing. But we provide a value for href attribute and the MUI docs says that:
The URL to link to when the button is clicked. If defined, an a element will be used as the root node.
So this hard-coded href value made this to always render as an A element (except print mode) and never a BUTTON.
Proposed solution
I think I'll keep the element but remove the attribute to eliminate the query string change.
The text was updated successfully, but these errors were encountered:
Describe the bug
An issue with DocumentHandler buttons in infoclick was just discovered. As of #1252, Hajk listens to change of the query string parameter of URL (everything after
#
). If that string changes, Hajk acts upon those changes (see #1252 for a list of parameters it looks for).Now, DocumentHandler can produce infoclick buttons using the
{foobar}@@documenthandler
notation.The problem is that currently the HTML element produced by this function is an anchor with a
href
value of"#"
. Clicking such a button changes the value of the query string, which in turns leads to new params being parsed by Hajk as of #1252.But since the string is empty and it specifically lacks the
m
parameter, Hajk interprets this as a change of map from whatever the current value is to the default one.Since a change of map config involves app reload, this is what happens:
Skarminspelning.2023-06-05.kl.14.59.10.mov
A better behaviour would be something like this:
Skarminspelning.2023-06-05.kl.14.58.42.mov
There's a small detail though: we don't want to change from
A
toBUTTON
, since they render differently.This portion of code looks a bit funny too:
We want to render a
BUTTON
when not printing. But we provide a value forhref
attribute and the MUI docs says that:So this hard-coded
href
value made this to always render as anA
element (except print mode) and never aBUTTON
.Proposed solution
I think I'll keep the element but remove the attribute to eliminate the query string change.
The text was updated successfully, but these errors were encountered: