File tree Expand file tree Collapse file tree 6 files changed +16
-24
lines changed
Expand file tree Collapse file tree 6 files changed +16
-24
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,9 @@ export const SuggestionMenuItem = forwardRef<
2222 itemRef . current . closest ( ".bn-suggestion-menu, #ai-suggestion-menu" ) ! ,
2323 ) ;
2424
25- if ( overflow === "top" ) {
26- itemRef . current . scrollIntoView ( true ) ;
27- } else if ( overflow === "bottom" ) {
28- itemRef . current . scrollIntoView ( false ) ;
25+
26+ if ( overflow !== "none" ) {
27+ itemRef . current . scrollIntoView ( { block : "nearest" } ) ;
2928 }
3029 } , [ isSelected ] ) ;
3130
Original file line number Diff line number Diff line change @@ -22,10 +22,9 @@ export const GridSuggestionMenuItem = forwardRef<
2222 itemRef . current . closest ( ".bn-grid-suggestion-menu" ) ! ,
2323 ) ;
2424
25- if ( overflow === "top" ) {
26- itemRef . current . scrollIntoView ( true ) ;
27- } else if ( overflow === "bottom" ) {
28- itemRef . current . scrollIntoView ( false ) ;
25+
26+ if ( overflow !== "none" ) {
27+ itemRef . current . scrollIntoView ( { block : "nearest" } ) ;
2928 }
3029 } , [ isSelected ] ) ;
3130
Original file line number Diff line number Diff line change @@ -29,10 +29,8 @@ export const SuggestionMenuItem = forwardRef<
2929 ".bn-suggestion-menu, #ai-suggestion-menu"
3030 ) ! ) ;
3131
32- if ( overflow === "top" ) {
33- itemRef . current . scrollIntoView ( true ) ;
34- } else if ( overflow === "bottom" ) {
35- itemRef . current . scrollIntoView ( false ) ;
32+ if ( overflow !== "none" ) {
33+ itemRef . current . scrollIntoView ( { block : "nearest" } ) ;
3634 }
3735 } , [ isSelected ] ) ;
3836
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ export const GridSuggestionMenuItem = forwardRef<
2424 itemRef . current . closest ( ".bn-grid-suggestion-menu" ) ! ,
2525 ) ;
2626
27- if ( overflow === "top" ) {
28- itemRef . current . scrollIntoView ( true ) ;
29- } else if ( overflow === "bottom" ) {
30- itemRef . current . scrollIntoView ( false ) ;
27+
28+ if ( overflow !== "none" ) {
29+ itemRef . current . scrollIntoView ( { block : "nearest" } ) ;
3130 }
3231 } , [ isSelected ] ) ;
3332
Original file line number Diff line number Diff line change @@ -26,10 +26,9 @@ export const SuggestionMenuItem = forwardRef<
2626 itemRef . current ,
2727 itemRef . current . closest ( ".bn-suggestion-menu, #ai-suggestion-menu" ) ! ,
2828 ) ;
29- if ( overflow === "top" ) {
30- itemRef . current . scrollIntoView ( true ) ;
31- } else if ( overflow === "bottom" ) {
32- itemRef . current . scrollIntoView ( false ) ;
29+
30+ if ( overflow !== "none" ) {
31+ itemRef . current . scrollIntoView ( { block : "nearest" } ) ;
3332 }
3433 } , [ isSelected ] ) ;
3534
Original file line number Diff line number Diff line change @@ -24,10 +24,8 @@ export const GridSuggestionMenuItem = forwardRef<
2424 itemRef . current . closest ( ".bn-grid-suggestion-menu" ) ! ,
2525 ) ;
2626
27- if ( overflow === "top" ) {
28- itemRef . current . scrollIntoView ( true ) ;
29- } else if ( overflow === "bottom" ) {
30- itemRef . current . scrollIntoView ( false ) ;
27+ if ( overflow !== "none" ) {
28+ itemRef . current . scrollIntoView ( { block : "nearest" } ) ;
3129 }
3230 } , [ isSelected ] ) ;
3331
You can’t perform that action at this time.
0 commit comments