@@ -6,7 +6,9 @@ import { computed, ref, defineComponent } from 'vue';
6
6
import type { VueNode } from '../_util/type' ;
7
7
import type { DropdownRender , Placement , RenderDOMFunc } from './BaseSelect' ;
8
8
9
- const getBuiltInPlacements = ( adjustX : number ) => {
9
+ const getBuiltInPlacements = ( dropdownMatchSelectWidth : number | boolean ) => {
10
+ // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
11
+ const adjustX = dropdownMatchSelectWidth === true ? 0 : 1 ;
10
12
return {
11
13
bottomLeft : {
12
14
points : [ 'tl' , 'bl' ] ,
@@ -43,14 +45,6 @@ const getBuiltInPlacements = (adjustX: number) => {
43
45
} ;
44
46
} ;
45
47
46
- const getAdjustX = (
47
- adjustXDependencies : Pick < SelectTriggerProps , 'autoAdjustOverflow' | 'dropdownMatchSelectWidth' > ,
48
- ) => {
49
- const { autoAdjustOverflow, dropdownMatchSelectWidth } = adjustXDependencies ;
50
- if ( ! ! autoAdjustOverflow ) return 1 ;
51
- // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
52
- return typeof dropdownMatchSelectWidth !== 'number' ? 0 : 1 ;
53
- } ;
54
48
export interface RefTriggerProps {
55
49
getPopupElement : ( ) => HTMLDivElement ;
56
50
}
@@ -72,7 +66,6 @@ export interface SelectTriggerProps {
72
66
getPopupContainer ?: RenderDOMFunc ;
73
67
dropdownAlign : object ;
74
68
empty : boolean ;
75
- autoAdjustOverflow ?: boolean ;
76
69
getTriggerDOMNode : ( ) => any ;
77
70
onPopupVisibleChange ?: ( visible : boolean ) => void ;
78
71
@@ -90,7 +83,6 @@ const SelectTrigger = defineComponent<SelectTriggerProps, { popupRef: any }>({
90
83
dropdownStyle : PropTypes . object ,
91
84
placement : String ,
92
85
empty : { type : Boolean , default : undefined } ,
93
- autoAdjustOverflow : { type : Boolean , default : undefined } ,
94
86
prefixCls : String ,
95
87
popupClassName : String ,
96
88
animation : String ,
@@ -107,13 +99,8 @@ const SelectTrigger = defineComponent<SelectTriggerProps, { popupRef: any }>({
107
99
} as any ,
108
100
setup ( props , { slots, attrs, expose } ) {
109
101
const builtInPlacements = computed ( ( ) => {
110
- const { autoAdjustOverflow, dropdownMatchSelectWidth } = props ;
111
- return getBuiltInPlacements (
112
- getAdjustX ( {
113
- autoAdjustOverflow,
114
- dropdownMatchSelectWidth,
115
- } ) ,
116
- ) ;
102
+ const { dropdownMatchSelectWidth } = props ;
103
+ return getBuiltInPlacements ( dropdownMatchSelectWidth ) ;
117
104
} ) ;
118
105
const popupRef = ref ( ) ;
119
106
expose ( {
0 commit comments