Skip to content

:active pseudo-class is applied to ancestor chain on mousedown #877

@LuckerCracker

Description

@LuckerCracker

When clicking an element, :active is set on every ancestor in the event chain, not just the actual target element.

Steps to reproduce

  1. Run rmlui_sample_demo.
  2. Click any interactive element.

Expected behavior
Only the clicked element should receive :active (target phase).

Actual behavior
All ancestors receive :active as the event bubbles.

Root cause (code)
Element::ProcessDefaultAction() sets :active on mousedown without checking event phase.

Proposed fix
Only set :active for EventPhase::Target on EventId::Mousedown.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions