( optionOffset: number, optionHeight: number, currentScrollPosition: number, panelHeight: number, )
| 328 | * @docs-private |
| 329 | */ |
| 330 | export function _getOptionScrollPosition( |
| 331 | optionOffset: number, |
| 332 | optionHeight: number, |
| 333 | currentScrollPosition: number, |
| 334 | panelHeight: number, |
| 335 | ): number { |
| 336 | if (optionOffset < currentScrollPosition) { |
| 337 | return optionOffset; |
| 338 | } |
| 339 | |
| 340 | if (optionOffset + optionHeight > currentScrollPosition + panelHeight) { |
| 341 | return Math.max(0, optionOffset - panelHeight + optionHeight); |
| 342 | } |
| 343 | |
| 344 | return currentScrollPosition; |
| 345 | } |
no test coverage detected