Skip to content

Toggling computer analysis produces console error and "shake"/scroll the screen. #12544

@TheMadSword

Description

@TheMadSword

Exact URL of where the bug happened

https://lichess.org/mQxdRPVn or any game analysis page.

Steps to reproduce the bug

Sub-bug 1 :

  1. Open the link / or a game analysis
  2. Ensure Computer analysis is activated and the tab is selected
  3. Open Console (F12)
  4. Press 'z' to Turn computer analysis off
  5. (Sub-bug 1) Notice the following error :

lichess.min.js:2 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Element': 'span:eq(1)' is not a valid selector. [...]

In Safari, we get instead :

SyntaxError: The string did not match the expected pattern.

6a. (Sub-bug 2) Notice that no tab is selected. Reading the code is seems rather clear that the intended behavior is to selected the 2nd tab ("Move times"), but the error prevent that.

6b. If you scroll down before pressing 'z', there is a shake/scroll-up effect [probably resolution specific], as we're waiting 50 ms before selecting a tab. This make sense when adding a tab (as we need to wait for the tab to be added), but makes no sense when removing a tab, as it will immediately scroll up (since we'll lose focus on a component, instead of selecting the other tag right away).

What did you expect to happen?

No error in console, and pressing 'z' should select the first tab instead of unselecting tab (via erroring).

What happened instead?

(1)An error occured, and (2) a scroll-up occured.

Operating system

Mac M1

Browser and version (or alternate access method)

Chrome, Firefox and Safari

Additional information

See PR #12545

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions