File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed
components/vc-tree-select Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,16 @@ export default defineComponent({
151151
152152 // >>> Select item
153153 case KeyCode . ENTER : {
154- const { selectable, value } = activeEntity . value ?. node || { } ;
155- if ( activeEntity . value && selectable !== false ) {
156- onInternalSelect ( null , {
157- node : { key : activeKey . value } ,
158- selected : ! legacyContext . checkedKeys . includes ( value ) ,
159- } ) ;
154+ if ( activeEntity . value ) {
155+ const { selectable, value } = activeEntity . value . node || { } ;
156+ if ( selectable !== false ) {
157+ onInternalSelect ( null , {
158+ node : { key : activeKey . value } ,
159+ selected : ! legacyContext . checkedKeys . includes ( value ) ,
160+ } ) ;
161+ }
160162 }
163+
161164 break ;
162165 }
163166
@@ -233,6 +236,7 @@ export default defineComponent({
233236 showLine = { treeLine }
234237 loadData = { searchValue ? null : ( loadData as any ) }
235238 motion = { treeMotion }
239+ activeKey = { activeKey . value }
236240 // We handle keys by out instead tree self
237241 checkable = { checkable }
238242 checkStrictly
Original file line number Diff line number Diff line change @@ -387,7 +387,15 @@ export default defineComponent({
387387 const values = displayKeys . map (
388388 key => keyEntities . value [ key ] ?. node ?. [ mergedFieldNames . value . value ] ?? key ,
389389 ) ;
390- const rawDisplayValues = convert2LabelValues ( values ) ;
390+ // Back fill with origin label
391+ const labeledValues = values . map ( val => {
392+ const targetItem = rawLabeledValues . value . find ( item => item . value === val ) ;
393+ return {
394+ value : val ,
395+ label : targetItem ?. label ,
396+ } ;
397+ } ) ;
398+ const rawDisplayValues = convert2LabelValues ( labeledValues ) ;
391399
392400 const firstVal = rawDisplayValues [ 0 ] ;
393401
@@ -728,6 +736,7 @@ export default defineComponent({
728736 emptyOptions = { ! mergedTreeData . value . length }
729737 onDropdownVisibleChange = { onInternalDropdownVisibleChange }
730738 tagRender = { props . tagRender || slots . tagRender }
739+ dropdownMatchSelectWidth = { props . dropdownMatchSelectWidth ?? true }
731740 />
732741 ) ;
733742 } ;
Original file line number Diff line number Diff line change 1- // base rc-tree-select@5.0.0-alpha .4
1+ // base rc-tree-select@5.1 .4
22import type { TreeSelectProps } from './TreeSelect' ;
33import TreeSelect , { treeSelectProps } from './TreeSelect' ;
44import TreeNode from './TreeNode' ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export function formatStrategyValues(
2424 if (
2525 entity &&
2626 entity . children &&
27+ entity . children . some ( ( { node } ) => valueSet . has ( node [ fieldNames . value ] ) ) &&
2728 entity . children . every (
2829 ( { node } ) => isCheckDisabled ( node ) || valueSet . has ( node [ fieldNames . value ] ) ,
2930 )
You can’t perform that action at this time.
0 commit comments