From 5f42efc3b03d0d7d3f6e26bba3218e7c51b07306 Mon Sep 17 00:00:00 2001 From: pasatandrei Date: Thu, 31 Oct 2024 15:01:18 +0200 Subject: [PATCH 1/2] Modified n-mention for case-insensitive filtering --- src/mention/src/Mention.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mention/src/Mention.tsx b/src/mention/src/Mention.tsx index 95644f82594..1dcf0abeafc 100644 --- a/src/mention/src/Mention.tsx +++ b/src/mention/src/Mention.tsx @@ -55,15 +55,15 @@ export const mentionProps = { (pattern: string, option: MentionOption) => boolean >, default: (pattern: string, option: MentionOption) => { - if (!pattern) - return true - if (typeof option.label === 'string') { - return option.label.startsWith(pattern) - } - if (typeof option.value === 'string') { - return option.value.startsWith(pattern) - } - return false + if (!pattern) return true; + const lowerCasePattern = pattern.toLowerCase(); + + // Match both label and value, if they are strings + const matchesLabel = typeof option.label === 'string' && option.label.toLowerCase().startsWith(lowerCasePattern); + const matchesValue = typeof option.value === 'string' && option.value.toLowerCase().startsWith(lowerCasePattern); + + // Return true if either matches + return matchesLabel || matchesValue; } }, type: { From 16966edb1201952d3fd4aef4c3a74767222d2766 Mon Sep 17 00:00:00 2001 From: pasatandrei Date: Mon, 4 Nov 2024 15:14:14 +0200 Subject: [PATCH 2/2] Fix typescript issue --- src/carousel/src/Carousel.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/carousel/src/Carousel.tsx b/src/carousel/src/Carousel.tsx index ac5a3f1daac..ee8c877eff6 100644 --- a/src/carousel/src/Carousel.tsx +++ b/src/carousel/src/Carousel.tsx @@ -739,8 +739,10 @@ export default defineComponent({ } function handleSlideResize(): void { if (autoSlideSizeRef.value) { - slideSizesRef.effect.scheduler?.() - slideSizesRef.effect.run() + // slideSizesRef.effect.scheduler?.() + // slideSizesRef.effect.run() + ;(slideSizesRef.effect as any).scheduler?.() + ;(slideSizesRef.effect as any).run() } } function handleMouseenter(): void {