Merge pull request #865 from Demonthos/fix-anchor-link-for-block-level-elements
Fix anchor link for block-level elements
This commit is contained in:
1 file changed
+5
-4
@@ -357,10 +357,11 @@ class Interpreter {
|
|||||||
|
|
||||||
if (event.type === "click") {
|
if (event.type === "click") {
|
||||||
// todo call prevent default if it's the right type of event
|
// todo call prevent default if it's the right type of event
|
||||||
if (shouldPreventDefault !== `onclick`) {
|
let a_element = target.closest("a");
|
||||||
if (target.tagName === "A") {
|
if (a_element != null) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const href = target.getAttribute("href");
|
if (shouldPreventDefault !== `onclick` && a_element.getAttribute(`dioxus-prevent-default`) !== `onclick`) {
|
||||||
|
const href = a_element.getAttribute("href");
|
||||||
if (href !== "" && href !== null && href !== undefined) {
|
if (href !== "" && href !== null && href !== undefined) {
|
||||||
window.ipc.postMessage(
|
window.ipc.postMessage(
|
||||||
serializeIpcMessage("browser_open", { href })
|
serializeIpcMessage("browser_open", { href })
|
||||||
|
|||||||
Reference in new issue
Block a user