stdlib-js / www

Website for stdlib, a standard library for JavaScript and Node.js.
https://stdlib.io
Apache License 2.0
7 stars 8 forks source link

[Bug] Side menu does not reset to previous collapse/uncollapsed state when clearing the filter #10

Closed kgryte closed 2 years ago

kgryte commented 2 years ago

Checklist

Please ensure the following tasks are completed before filing a bug report.

Description

Description of the issue.

Encountered an error when clearing the filter in the side menu. When filtering, the menu automatically expands to highlight those packages which match the filter. However, on clearing the menu, the filter remains expanded.

Preferably, we'd return the menu to its previous unfiltered state (presumably a mixture of collapsed/uncollapsed based on prior user behavior). Otherwise, can be fully collapsed (i.e., the menu resets).

Related Issues

Does this issue have any related issues?

No.

Questions

Any questions for reviewers?

No.

Other

Any other information relevant to this issue? This may include screenshots, references, stack traces, sample output, and/or implementation notes.

Demo

If relevant, provide a link to a live demo.

For a live demo of the issue, see

Reproduction

What steps are required to reproduce the unexpected output?

In order to reproduce this bug, do the following:

Expected Results

What are the expected results?

The following results are expected:

Actual Results

What are the actual results?

The following are the actual results:

Environments

What environments are affected (e.g., Node v0.4.x, Chrome, IE 11)? If Node.js, include the npm version, operating system, and any other potentially relevant platform information.

The following environments are affected:

kgryte commented 2 years ago

Hmm...seeing that this only seems to affect the latest (non-public) version of the API docs. 🤦‍♂️

kgryte commented 2 years ago

Live update: I am now failing to reproduce.

kgryte commented 2 years ago

Okay. Was able to reproduce. This is an intermittent bug. Sometimes if I delete what is in the filter input box very quickly, the side menu does not update its collapse/expand state. Not sure what is happening here, as it does not always fail to reset.

kgryte commented 2 years ago

This seems to be a problem with how we are debouncing an internal callback. I can reproduce by entering a filter string and then quickly hitting backspace until the filter is empty.

kgryte commented 2 years ago

This should be addressed in the latest deployed docs. I updated the logic for restoring collapse state.