File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/react-widgets/src Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface FocusProps {
2626}
2727
2828export interface FocusList < TDataItem = unknown > {
29+ size ( ) : number ;
2930 focus : ( el : HTMLElement | null | undefined ) => void
3031 first : ( ) => HTMLElement | undefined
3132 last : ( ) => HTMLElement | undefined
@@ -103,6 +104,10 @@ export const useFocusList = <TDataItem>({
103104
104105 const list : any = useMemo ( ( ) => {
105106 return {
107+ size ( ) {
108+ const [ items ] = get ( ) ;
109+ return items . length ;
110+ } ,
106111 get,
107112 toDataItem : ( el : HTMLElement ) => map . get ( el ) ,
108113
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ const Multiselect: Multiselect = React.forwardRef(function Multiselect<
383383 */
384384
385385 const handleDelete = ( dataItem : TDataItem , event : React . SyntheticEvent ) => {
386- if ( isDisabled || readOnly ) return
386+ if ( isDisabled || readOnly || tagList . size ( ) === 0 ) return
387387 focus ( )
388388 change ( dataItem , event , REMOVE )
389389 }
You can’t perform that action at this time.
0 commit comments