Skip to content

Fix dropdown resetting focus#1559

Open
Arnei wants to merge 2 commits intoopencast:r/19.xfrom
Arnei:jumpy-dropdowns
Open

Fix dropdown resetting focus#1559
Arnei wants to merge 2 commits intoopencast:r/19.xfrom
Arnei:jumpy-dropdowns

Conversation

@Arnei
Copy link
Copy Markdown
Member

@Arnei Arnei commented Apr 2, 2026

Fixes #1506.

Various dropdown (Table filters, workflow selector, pretty much everything in the ACL tab) would seemingly randomly have their focus reset to the top element every couple of seconds. This would make them hard or even impossible to navigate by users. This patch aims to fix that.

The culprit here is a selector hook at the app level. The Stats component (the various numbers next to the "Add Event" button) would trigger this hook about every 5 seconds, causing the whole app to rerender and the dropdowns to reset focus.

The proposed solution is to not use a selector. This will make our custom hook useTableFilterStateValidation effectively only run once on page load. I would argue this is fine, as we do not expect the state to corrupt while the app is running and thus don't need to check for corrupt state everytime the state changes.

Also moves the code for fetching table info and filters from TablePage into Table and TableFilters.
The goal here is to prevent the fetching code from rerendering unrelate components in TablePage.

How to test this

Can be tested as is.

Arnei added 2 commits April 2, 2026 11:23
Various dropdown (Table filters, workflow selector, pretty much
everything in the ACL tab) would
seemingly randomly have their
focus reset to the top element
every couple of seconds.
This would make them hard or even impossible to navigate by users.
This patch aims to fix that.

The culprit here is a selector hook at the app level. The `Stats`
component (the various numbers next to the "Add Event" button)
would trigger this hook about every 5 seconds, causing the
whole app to rerender and the
dropdowns to reset focus.

The proposed solution is to not use a selector. This will make our
custom hook `useTableFilterStateValidation`
effectively only run once on page load. I would argue this is fine, as
we do not expect the state to corrupt while the app is running
and thus don't need to check for corrupt state everytime the state
changes.
Moves the code for fetching table info and filters from `TablePage`
into `Table` and `TableFilters`.
The goal here is to prevent the fetching code from rerendering
unrelate components in `TablePage`.
@Arnei Arnei added the type:bug Something isn't working label Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/admin-interface:pr-1559

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/admin-interface:pr-1559

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant