bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

Tooltip shown on focus should update the `aria-describedby` pointer of the active element to point to the tooltip. #9907

Open ExtAnimal opened 1 month ago

ExtAnimal commented 1 month ago

Forum post

Tooltip.js needs:

    updateActiveTarget(newTarget, lastTarget) {
        const
            me            = this,
            activeElement = DomHelper.getActiveElement(newTarget);

        if (newTarget) {
            if (!me.isConfiguring) {
                me.trigger('overTarget', { newTarget, lastTarget });
            }

            // If the target which we are active for contains the currently active element or vice versa
            // then that is the element this tooltip is describing,
            me.describedElement = newTarget.contains(activeElement) || me.triggeredByEvent.pointerType === 'focus' ? activeElement : null;
        }
        else {
            me.trigger('targetOut', { lastTarget });
            me.describedElement = null;
        }
    }