Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case sensitive in search n mentions component #6517

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/carousel/src/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions src/mention/src/Mention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down