8000 Attach Event Handlers to an event queue · Issue #1320 · reactive-python/reactpy · GitHub
[go: up one dir, main page]

Skip to content

Attach Event Handlers to an event queue #1320

@Archmonger

Description

@Archmonger

Current Situation

Currently, any events that occur while the server is actively re-rendering the page get ignored. This means that if a user clicks 10 times very rapidly, it's possible many of those clicks would get ignored. On the server side, this scenario would always result in reactpy.core.layout:Layout.deliver() generating the following error: f"Ignored event - handler {event['target']!r} does not exist or its component unmounted".

Proposed Actions

Tie a FIFO event queue for attached event handlers, and process them in sequential order. Make sure this queue is tied to the element's key identity, and only discard events if the element no longer exists.

A few ideas on how this could be done:

  • This may require events to transmit information about the React DOM key-identity path of the associated event handler.
  • We could generate unique IDs for each event handler queue, which is ultimately linked to the key identity of the element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-2-moderateShould be resolved on a reasonable timeline.type-revisionAbout a change in functionality or behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0