Skip to content

Inconsistent behavior on Escape and Enter in debug mode #865

Open
@sarahdayan

Description

@sarahdayan

Description

When debug=true and you close the panel while still having pending requests, the resulting behavior is different depending on how you closed the panel:

  • If you closed the panel with Escape, the panel stays closed
  • If you closed the panel with Enter, the panel reopens

This needs further investigations, but it's likely caused by different logic in the state reducer:

This behavior was initially observed in this followup.

Reproduction

Preview →

Steps

  1. Throttle your browser (e.g., slow 3G)
  2. Type and quickly hit Escape (before network requests are settled), see how the panel remains closed
  3. Type and quickly hit Enter (before network requests are settled), see how the panel reopens

Expected behavior

In both cases, the panel should stay closed even with debug enabled because these are intentional closing behaviors.

This might be questionable, and we may need to further specify how we want debug to behave (e.g., can you ever close the panel?)

Environment

  • OS: macOs Big Sur 11.5.1
  • Browser: Firefox 95.0.2
  • Autocomplete version: 1.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions