Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip on button that becomes disabled does not disappear #12

Open
angrytongan opened this issue Jan 31, 2020 · 1 comment
Open

Tooltip on button that becomes disabled does not disappear #12

angrytongan opened this issue Jan 31, 2020 · 1 comment

Comments

@angrytongan
Copy link

Disabling a button with a tooltip shown does not remove the tooltip. Tested with Chrome on Mac OS X.

const {
    Button,
    FocusManager,
    Tooltip,

} = CUI;
FocusManager.showFocusOnlyOnTab();

const TooltipDisablingButton = () => {
    let buttonDisabled = false;

    return {
        view: () => {
            return m(Tooltip, {
                content: 'Tooltip remains after button disabled',
                trigger: m(Button, {
                    label: 'Click to disable',
                    disabled: buttonDisabled,
                    onclick: () => {
                        buttonDisabled = true;
                    },
                })
            });
        },
    };
};

document.addEventListener('DOMContentLoaded', () => {
    m.route(document.body, '/', {
        '/': TooltipDisablingButton
    });
});
@vrimar
Copy link
Owner

vrimar commented Mar 16, 2020

I'm going to rework the Tooltip logic, seems like it has quite a few issues I didn't consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants