Skip to content

Tooltip on button that becomes disabled does not disappear #12

@angrytongan

Description

@angrytongan

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
    });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions