( dropdownMatchSelectWidth: number | boolean, )
| 5 | import type { Placement, RenderDOMFunc } from './BaseSelect'; |
| 6 | |
| 7 | const getBuiltInPlacements = ( |
| 8 | dropdownMatchSelectWidth: number | boolean, |
| 9 | ): Record<string, AlignType> => { |
| 10 | // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided |
| 11 | const adjustX = dropdownMatchSelectWidth === true ? 0 : 1; |
| 12 | return { |
| 13 | bottomLeft: { |
| 14 | points: ['tl', 'bl'], |
| 15 | offset: [0, 4], |
| 16 | overflow: { |
| 17 | adjustX, |
| 18 | adjustY: 1, |
| 19 | }, |
| 20 | htmlRegion: 'scroll', |
| 21 | }, |
| 22 | bottomRight: { |
| 23 | points: ['tr', 'br'], |
| 24 | offset: [0, 4], |
| 25 | overflow: { |
| 26 | adjustX, |
| 27 | adjustY: 1, |
| 28 | }, |
| 29 | htmlRegion: 'scroll', |
| 30 | }, |
| 31 | topLeft: { |
| 32 | points: ['bl', 'tl'], |
| 33 | offset: [0, -4], |
| 34 | overflow: { |
| 35 | adjustX, |
| 36 | adjustY: 1, |
| 37 | }, |
| 38 | htmlRegion: 'scroll', |
| 39 | }, |
| 40 | topRight: { |
| 41 | points: ['br', 'tr'], |
| 42 | offset: [0, -4], |
| 43 | overflow: { |
| 44 | adjustX, |
| 45 | adjustY: 1, |
| 46 | }, |
| 47 | htmlRegion: 'scroll', |
| 48 | }, |
| 49 | }; |
| 50 | }; |
| 51 | |
| 52 | export interface RefTriggerProps { |
| 53 | getPopupElement: () => HTMLDivElement; |
no outgoing calls
no test coverage detected
searching dependent graphs…