Live data from Hacker News

Don't attach tooltips to document.body

atfzl.com

81–90 of 98 posts

Re: Don't attach tooltips to document.body

#81

It would be nice if the browser title text feature didn't flat out suck. Why is there no way to show tooltips immediately rather than having to wait a few seconds. Seems like every website reimplements them because the browser ones are useless.

I agree, I hate how long it takes for the title attribute to show up when hovering over elements. It takes a few seconds, where any decent tooltip will take maybe 0.5 seconds or so to show up. I'd love to be able to style the title attribute for length of time to show up.

Fortunately tooltips are pretty easy to make these days. You don't need Javascript at all to make a nice tooltip. But again, it's a tooltip - it's been done so many times before that it'd be nice to have a native browser version.

Re: Don't attach tooltips to document.body

#82
post #22

... this post perfectly encapsulates why I hate web development. A painful and easy to miss bug when trying to reimplement a GUI feature that's been available in every decent GUI framework for over two decades.

I really wish we'd gotten a couple more useful native controls back when there was any will to add that kind of stuff... It's sad/annoying to see all this reimplementation of simple stuff like comboboxes, and then all this extra effort to make it work OK in different form factors... The great experience of the select element that just gets you a mobile appropriate native UI for free is unavailable for so many simple…

> I really wish we'd gotten a couple more useful native controls back when there was any will to add that kind of stuff...

We're trying, and we need help: https://open-ui.org/

Come say Hi on Discord, anyone who has written a JS control has input that the project needs.

Re: Don't attach tooltips to document.body

#83
post #72
post #22

... this post perfectly encapsulates why I hate web development. A painful and easy to miss bug when trying to reimplement a GUI feature that's been available in every decent GUI framework for over two decades.

Web makes it super easy to build custom components compared to something like Qt, GtK or even UIKit. One of the reasons why web UIs are common is that people want more than tables buttons and forms.

I literally make a living tuning React Native shitheaps:

On mobile, as a rule, the second a design transcends things like tables, buttons, and forms is when the “lower level” native APIs start getting broken out.

Wrapped in nice little JS/TS APIs so nobody freaks out, of course.

Re: Don't attach tooltips to document.body

#85
post #22

... this post perfectly encapsulates why I hate web development. A painful and easy to miss bug when trying to reimplement a GUI feature that's been available in every decent GUI framework for over two decades.

Worth noting:

- browsers have had native text tooltips for at least 20 years

- there are active proposals intended to address richer tooltips and similar use cases

- adding new controls to the web is a complex matter because there are a lot of stakeholders to consider, and a lot of consensus to build among implementers/standards authors

- complaints about missing UI features on the web often overlap with complaints about standards bloat and browser bloat

- this article is rich in technical information that’s applicable more broadly than the tooltip use case, and maybe every single article about anything web on HN doesn’t need to be drowned in generic myopic complaints about the web

Re: Don't attach tooltips to document.body

#86
post #22

... this post perfectly encapsulates why I hate web development. A painful and easy to miss bug when trying to reimplement a GUI feature that's been available in every decent GUI framework for over two decades.

I see this comment on every single post about a difficult thing to do in web, but I never seem to see it in the countless articles that also show up about similar edge-case bugs in non-web development. Odd.

Re: Don't attach tooltips to document.body

#87

Earlier quoted context omitted.

this is exactly why SPA's get a bad rep: developers think an 80ms delay on a minor render operation is acceptable

The same could be said for php, c, or even basic. They get a bad rep, but it's perfectly possible to create something secure, stable, maintainable and performant

[deleted]

Re: Don't attach tooltips to document.body

#88
post #72

Earlier quoted context omitted.

Web makes it super easy to build custom components compared to something like Qt, GtK or even UIKit. One of the reasons why web UIs are common is that people want more than tables buttons and forms.

I literally make a living tuning React Native shitheaps: On mobile, as a rule , the second a design transcends things like tables, buttons, and forms is when the “lower level” native APIs start getting broken out. Wrapped in nice little JS/TS APIs so nobody freaks out, of course.

React Native is not web, it’s the lowest common denominator of all platforms, so your experience is not surprising.

Having developed custom elements in both web and native, I felt that web was easier and more predictable than native. (For example adding clipping to images on iOS throws away most possible optimisations resulting in abysmal FPS) Of course the “best possible” UI is also slower and worse than what could be done in native.

(Also, on mobile I firmly believe that native is the right way to go with the current tech)

Re: Don't attach tooltips to document.body

#89
post #62
post #22

... this post perfectly encapsulates why I hate web development. A painful and easy to miss bug when trying to reimplement a GUI feature that's been available in every decent GUI framework for over two decades.

This perfectly encapsulated why I LOVE web development. You can debug one of the most complex softwares in the world (a browser) so effectively you can understand what you did wrong and fix it.

Until a browser update changes the behavior or different browser engines have different behaviors.

Re: Don't attach tooltips to document.body

#90
post #32

Earlier quoted context omitted.

I really wish we'd gotten a couple more useful native controls back when there was any will to add that kind of stuff... It's sad/annoying to see all this reimplementation of simple stuff like comboboxes, and then all this extra effort to make it work OK in different form factors... The great experience of the select element that just gets you a mobile appropriate native UI for free is unavailable for so many simple…

The "problem" with native controls is that they might visually clash with the design of your website. That's why everybody implements their own controls or uses libraries like jQuery. And sadly, that's probably why we don't have good default controls.

I have trouble seeing this as a problem, especially with electron and other local web-tech stacks.

I miss the days when clickable things looked clickable.

Post reply on HN