Hacker News new | ask | show | jobs
by grandchild 1530 days ago
I find it telling that notion managed to break the core web concept of the hyperlink by implementing their own version of the <a> tag.

If I middle-click on a link to open it in a new tab, I paste-insert my clipboard content _into the link text_ instead (I'm on Linux). That's just horrible.

1 comments

(I work at Notion)

It's actually the browser's default behavior to do what you're describing! Inside a `contenteditable` element, links no longer behave as links -- they aren't clickable, and hovering over the link doesn't show a preview of the HREF attribute in the browsers I've tested. So in order for links to do link things, we have to fight the browser and re-implement these behaviors.

Here's a codesandbox with no JS to demonstate this: https://codesandbox.io/embed/optimistic-resonance-jbyeef?fon...

I created a task to track this bug internally. I think we can probably solve by calling preventDefault for the middle-click event if it bubbles up from inside a link.

Oh hey, I didn't see your reply until just now, thanks for the explanation and trying to resolve it! I understand the technical issue now.

I still don't understand the UX. Am I assuming correctly that it's core to the concept of Notion to always be editable and not have an edit/view flip switch? Because I never used Notion to write anything, I just read things other people wrote. And so it's arguably weird to interact with a webpage that as it turns out is secretly an editor only masquerading as a webpage. Sly!

(not gp) Is there any way to track the progress of this? I would be very happy to see this fixed.

Btw, if links inside a contenteditable aren't supposed to behave as links, why make it clickable in the first place? Because if you make it act like a link, you indeed have to reimplement the whole thing because of expectations.

I'm no interaction designer, but imho a simple edit button would be mucher simpler. It could still be integrated nicely, no need to have wiki-like editing where the entire context is lost.

I think an edit button could improve Notion’s UX for small touchscreen devices where drag gesture is used for both scrolling and editing, but it would make the product worse for larger screen devices with precise pointing. It’s better to work hard in order to build the ideal product, than to make developers lives easy at the cost of a worse product.