autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Inconsistent behavior on `Escape` and `Enter` in debug mode

Open sarahdayan opened this issue 2 years ago • 0 comments

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

sarahdayan avatar Jan 13 '22 16:01 sarahdayan