Skip to content

Commit

Permalink
Merge pull request #610 from docat-org/fix/empty-links-interpreted-as…
Browse files Browse the repository at this point in the history
…-not-empty

Fix empty links interpreted as not empty, resulted in weird behavior
  • Loading branch information
fliiiix authored Sep 8, 2023
2 parents d4aa4fd + 8fa13b5 commit d449012
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/src/components/IFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export default function IFrame(props: Props): JSX.Element {
return
}

if (a.href.trim() === '') {
// ignore empty links, may be handled with js internally,
// so we'll ignore it. Will inevitably cause the user to have to click back
const href = a.getAttribute('href') ?? ''
if (href.trim() === '') {
// ignore empty links, may be handled with js internally.
// Will inevitably cause the user to have to click back
// multiple times to get back to the previous page.
return
}
Expand Down

0 comments on commit d449012

Please sign in to comment.