vrimar / construct-ui

A Mithril.js UI library
https://vrimar.github.io/construct-ui
MIT License
287 stars 24 forks source link

Tooltips don't fade on mobile #9

Open angrytongan opened 4 years ago

angrytongan commented 4 years ago

Tooltips don't fade on mobile. Tested on Safari on iOS.

const {
    Button,
    Tooltip
} = CUI;

const MobileButtonTooltipNoFade = {
    view: () => {
        return m('', [
            m(Tooltip, {
                content: 'this tooltip doesn\'t fade on mobile',
                trigger: m(Button, {
                    label: 'Button',
                }),
            }),
        ]);
    }
};

document.addEventListener('DOMContentLoaded', () => {
    m.route(document.body, '/', {
        '/': MobileButtonTooltipNoFade
    });
});

Not sure if this is intended behaviour or not. Also not sure on accepted behaviour (the Material guidelines say to display for 1.5 seconds).

vrimar commented 4 years ago

What device/ios version are you using?

angrytongan commented 4 years ago

Tested on Safari on iOS. Also in Chrome on Mac OS X using devtools mobile view.

vrimar commented 4 years ago

Apologies for the delay, I tested the Tooltip component in Safari/Chrome on an iPad and I can't get it to open at all. I haven't implemented any touch events so I'm assuming it won't work correctly on mobile.

I took a look at how react material UI handles it. They have dedicated touchstart/touchend events to support mobile.

I'll keep this open for the future.