Merge pull request #220 from DioxusLabs/jk/outerlinking
fix: always prevent default on `A` tags in desktop
This commit is contained in:
commit
82b0e6c8d6
|
@ -204,12 +204,18 @@ export class Interpreter {
|
|||
// todo call prevent default if it's the right type of event
|
||||
if (shouldPreventDefault !== `onclick`) {
|
||||
if (target.tagName == "A") {
|
||||
event.preventDefault();
|
||||
const href = target.getAttribute("href");
|
||||
if (href !== "" && href !== null && href !== undefined) {
|
||||
window.rpc.call("browser_open", { href });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// also prevent buttons from submitting
|
||||
if (target.tagName == "BUTTON") {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
// walk the tree to find the real element
|
||||
while (realId == null) {
|
||||
|
|
Loading…
Reference in New Issue