Live data from Hacker News

Don't attach tooltips to document.body

atfzl.com

11–20 of 98 posts

Re: Don't attach tooltips to document.body

#12
This issue of needlessly forcing the system to recalculate a tree of positions and bonds is also common in other UI contexts such as desktop applications and game UIs.

In fact, in games it also happens with the transforms of objects and has been the cause of a number of performance issues during development of AAA games I've been part of.

Re: Don't attach tooltips to document.body

#14

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.

And that they don't work on mobile.

Re: Don't attach tooltips to document.body

#15

It's the same reason that most React apps start with ReactDOM.render( , document.getElementById('app')) instead of ReactDOM.render( , document.body). IIRC there were many tutorials in the early days of React that mentioned this.

I’d count that as largely unrelated. This is purely a performance optimisation, whereas mounting to an element other than the body is so that you can be somewhat more confident about the DOM inside your chosen root being in the shape you desire, since it’s common for third-party scripts, browser extensions and the likes to add children to the body (start or end), which can mess with VDOM resolution.

Re: Don't attach tooltips to document.body

#16

Earlier quoted context omitted.

Don't hold your breath...

Yes it’s more likely say Microsoft gives up on desktop ui and says meh… use electron!

Like for 'Teams'. But that is probably more of a result of not having a team of developers with a clue and management outnumbering developers five to one. You know it's true when they prioritise Salesforce integration of cut and paste working.

Some other major electron apps are pretty OK.

Re: Don't attach tooltips to document.body

#17

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.

And that they don't work on mobile.

Nor do custom tooltips though because the majority of websites and apps fire them on a mouseover event.

Re: Don't attach tooltips to document.body

#18
i wish we could come up with new tech for websites already. this html, css, js, css feels like being stuck in 18th century. just piling one shit spec on another. like, css still cannot do vertical centering to this day. and js had to come up with shadow dom and all that crap to make rendering faster. time to move on.

Re: Don't attach tooltips to document.body

#19
post #17

Earlier quoted context omitted.

And that they don't work on mobile.

Nor do custom tooltips though because the majority of websites and apps fire them on a mouseover event.

Tooltips on mobile are tough.

Tooltips usually are on links. For example here on HN, hover over "11 minutes ago" in the comment header and it shows the time. Could this be made available to mobile users? Seems tricky. My first thought would be to show it when the user taps and holds. But that also triggers the browsers default context menu for links. So it would make a murky experience.

Post reply on HN