Live data from Hacker News

Don't attach tooltips to document.body

atfzl.com

41–50 of 98 posts

Re: Don't attach tooltips to document.body

#41
post #32

Earlier quoted context omitted.

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.

> The "problem" with native controls is that they might visually clash with the design of your website. CSS can fix that once good native controls are implemented.

That requires the ability to style things like the dropdown of the combobox (e.g. to add rounded corners, change the background/border colour), and the rows for each items (e.g. adding padding, and divider border styling). At the moment, that is difficult because they are not part of the HTML box model. And what about styling controls like date input or colour pickers?

Another issue is styling checkboxes to use custom images for the different states (including hover and pressed styling).

The CSS UI spec (https://www.w3.org/TR/css-ui-4) doesn't detail any of that, and the WHATWG HTML spec only defines the values of input fields (e.g. https://html.spec.whatwg.org/#the-input-element), not what parts of things like a date control are available and how to style them.

Re: Don't attach tooltips to document.body

#42

Earlier quoted context omitted.

It's very minor, but when it happen many times, it'll be noticable. It's proven because author start the investigation. It won't be a problem if the tooltip has delayed appearance by 80ms, but it holds the process. So the site will have a 80ms stutter everytime a tooltip appear.

Which generally won't be noticed but it depends on the site. I'm not saying it isn't an issue just that I wouldn't call it a bug. Certainly not something so bad that it would turn you away from web dev. I mean we even have the tooling to track it down fairly easily

It's a bug. I don't care for your semantic separation of issue/bug and neither should you. Pointless distinction for the sake of ego protection. It is unwanted behaviour, therefore a bug.

Re: Don't attach tooltips to document.body

#43
post #31
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.

Same here. Got a job to do some java. 6 months later, I had to learn angular. 6 months later I was not in the company anymore. HTML was not designed to be dynamic. There are too many redundant feature of HTML/CSS/JS, and honestly I would make everything obsolete and design a new document format with a open binary format.

Exactly. HTML was a document markup language. Articles, etc. Some forms.

We're now building applications. Applications have a totally different layout model. Only recently we're able to use flexbox. But it's insane. Just build the layout / application in something that really works (any of platform UI toolkits / markups), and use HTML for document flow.

Re: Don't attach tooltips to document.body

#44

Earlier quoted context omitted.

I don't consider this a bug, it's really a very minor performance issue. 80ms isn't going to be noticed by users

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

Re: Don't attach tooltips to document.body

#45
post #35

Wait, you guys use tooltips? Some websites don't even have text accompanying their unintuitive but kewl looking icons. The future is now, old timers!

Tool tips are bad ui because they are invisible normally and are completely absent on touch inputs. Either use an icon so universal it needs no tip or use text.

Re: Don't attach tooltips to document.body

#46

Earlier quoted context omitted.

I don't consider this a bug, it's really a very minor performance issue. 80ms isn't going to be noticed by users

"Minor" performance issues add up quickly when there are more of them. And with this attitude there will be more of them

I never said it shouldn't be addressed if it is impacting the user experience

Re: Don't attach tooltips to document.body

#47

Earlier quoted context omitted.

I don't consider this a bug, it's really a very minor performance issue. 80ms isn't going to be noticed by users

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

You might be surprised just how fast 80ms really is. Again I'm not saying this shouldn't be addressed if it's causing noticeable issues but labeling it as a bug just seems strange to me (but that label wouldn't change the priority for me by itself)

Re: Don't attach tooltips to document.body

#48
post #42

Earlier quoted context omitted.

Which generally won't be noticed but it depends on the site. I'm not saying it isn't an issue just that I wouldn't call it a bug. Certainly not something so bad that it would turn you away from web dev. I mean we even have the tooling to track it down fairly easily

It's a bug. I don't care for your semantic separation of issue/bug and neither should you. Pointless distinction for the sake of ego protection. It is unwanted behaviour, therefore a bug.

Alright I guess we will just have to agree to disagree. For me, if an action takes slightly longer than it could take but isn't significantly impacting UX then I don't personally think of that as a bug. Maybe I just don't understand the impact this particular issue had

Re: Don't attach tooltips to document.body

#49
post #36
post #26

Earlier quoted context omitted.

Sounds awful. No accessibility to screen readers. It's raster-based so you can't zoom. No text selection or copying. And that's just what I thought of off the top of my head...

Shouldn't screen readers use OCR? I mean OCR is basically a solved problem, and there are situations when you want to read what's in an image, or when the HTML is a mess.

There's more to screen readers than characters, otherwise we wouldn't even need aria attributes.

Also OCR is a solved problem if we ban any form of display/script font types.

Re: Don't attach tooltips to document.body

#50
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.

You could argue that the browser does provide you with a “free”, native tooltip OOTB.
Post reply on HN