glide-data-grid icon indicating copy to clipboard operation
glide-data-grid copied to clipboard

scrollTo with enough space for the editor

Open pzcfg opened this issue 2 years ago • 1 comments

In #150 @ivoelbert added support to pass in padding to the scrollTo which is useful, however I need this to happen when appendRow is called as well. In my fork I'm just adding overscrollY to the scrollY here

https://github.com/glideapps/glide-data-grid/blob/91b2843ba5b248b7485293b8bc9f6fe53fb3a1fd/packages/core/src/data-editor/data-editor.tsx#L850

but it might be better to make this configurable or solve my issue at a higher level.

The main reason I need this one of our custom editors has suggestions listed below it, and if the added row is near the bottom they get cut off. If custom editors could provide some sort of minHeight and/or preferredHeight this could get added to the scroll.

Alternatively, making a way to configure adding overscrollY in scrollTo, or adding a new scrollPaddingY value would solve the problem.

pzcfg avatar Jun 21 '22 21:06 pzcfg

A better UX for your custom editor seemingly would be to have the popup go above when near the bottom of the screen. That said, yeah we should look for a sane method here.

jassmith avatar Jun 22 '22 15:06 jassmith

5.1.0 contains a vastly improved scrollTo API that can handle this need.

jassmith avatar Sep 01 '22 17:09 jassmith