Skip to content

Resolve "The currently selected view is not scrolled to automatically in the ViewsContext menu"

Merge Request Checklist

  • changelog.md has been updated if required
  • Documentation has been updated
  • Quality Standards are met
  • The UI/UX has been updated following UI Style Guide
  • The redoc API pages have been updated for any REST API changes
  • The per database user API docs page has been updated for any REST API changes made to endpoints which can be accessed via a user created token
  • Has performance been considered and tested when appropriate? Ideally Baserow should be performant when working with hundreds of thousands of rows
  • New/Changed Premium features are separated correctly in the premium folder
  • There are tests for and it has been checked that any changed/new django ORM code is sensible, doesn't perform N queries and that table models are not generated needlessly or generated with all columns when only a few are needed.

Closes #590 (closed) Closes #591 (closed)

This MR fixes both issue 590 and 591.

Detail

  • The ViewsContext component has been extended by a couple of methods that help with determining whether or not the currently selected view item is visible inside the views dropdown and based on that scrolls the dropdown until the selected view item is visible.
  • Given that a selected view item might be the last item in the dropdown it's not always possible to set a scroll position so that the selected view item is visible at the top of the dropdown. That's why I thought it is best to simply always have the selected view item at the bottom of the dropdown, unless it's one of the first fours views in the dropdown list (in which case no scrolling will happen).
  • When a new view gets created and the "view created" event propagates, a new method which scrolls the dropdown straight to the bottom (where the newly created view will be visible) will be called.
Edited by Ghost User

Merge request reports