Momo poppy/fix select :Fixed the problem of calculating the height of the Select component and creating an item incorrectly. (#358)

* chore: checkout release branch

* fix(select): Fix the issue of automatic creation of matching items when using the allowCreate property in the Select component

* fix(select): Fix the incorrect height of the input box when multiple attributes are selected when using the Select component

* fix(select): Fix the incorrect height of the input box when multiple attributes are selected when using the Select component

---------

Co-authored-by: Kagol <kagol@sina.com>
This commit is contained in:
MomoPoppy 2023-08-02 14:08:24 +08:00 committed by GitHub
parent e26f182602
commit d747c05c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1004 additions and 987 deletions

File diff suppressed because it is too large Load Diff

View File

@ -252,14 +252,14 @@ const initState = ({ reactive, computed, props, api, emitter, parent, constants
const addApi = ({ api, props, state, refs, emit, constants, parent, nextTick, dispatch, vm, designConfig }) => {
Object.assign(api, {
resetInputHeight: resetInputHeight({ api, constants, nextTick, props, refs, state }),
resetInputHeight: resetInputHeight({ constants, nextTick, props, refs, state }),
calcOverFlow: calcOverFlow({ refs, props, state }),
handleFocus: handleFocus({ api, emit, props, state }),
deleteTag: deleteTag({ api, constants, emit, props, vm, state }),
watchValue: watchValue({ api, constants, dispatch, props, refs, state }),
toHide: toHide({ constants, state, props, vm, api }),
toVisible: toVisible({ constants, state, props, vm, api, nextTick }),
setSelected: setSelected({ api, constants, nextTick, props, refs, state }),
setSelected: setSelected({ api, constants, nextTick, props, vm, state }),
selectOption: selectOption({ api, state, props }),
handleResize: handleResize({ api, props }),
watchOptions: watchOptions({ api, constants, nextTick, parent, props, state }),
@ -360,19 +360,25 @@ const initApi = ({
const addWatch = ({ watch, props, api, state }) => {
watch(() => [...state.options], api.watchOptions)
watch(() => state.gridData, api.setSelected, { immediate: true })
if (props.renderType === 'grid') {
watch(() => state.gridData, api.setSelected, { immediate: true })
}
watch(() => state.treeData, api.setSelected, { immediate: true })
if (props.renderType === 'tree') {
watch(() => state.treeData, api.setSelected, { immediate: true })
}
watch(() => state.hoverIndex, api.watchHoverIndex)
props.options && watch(() => props.options, api.watchPropsOption, { immediate: true, deep: true })
if (props.options) {
watch(() => props.options, api.watchPropsOption, { immediate: true, deep: true })
}
watch(() => state.optimizeOpts, api.watchOptimizeOpts)
}
const initWatch = ({ watch, props, api, state, nextTick, refs }) => {
props.treeOp.data &&
if (props.renderType === 'tree' && props.treeOp.data) {
watch(
() => props.treeOp.data,
(data) => {
@ -380,8 +386,9 @@ const initWatch = ({ watch, props, api, state, nextTick, refs }) => {
},
{ immediate: true, deep: true }
)
}
props.gridOp.data &&
if (props.renderType === 'grid' && props.gridOp.data) {
watch(
() => props.gridOp.data,
(data) => {
@ -389,6 +396,7 @@ const initWatch = ({ watch, props, api, state, nextTick, refs }) => {
},
{ immediate: true, deep: true }
)
}
watch(
() => state.selectDisabled,