Skip to content

Conversation

@onx2
Copy link

@onx2 onx2 commented Nov 23, 2025

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Comment on lines +59 to 61
if (substring.length === 0 || string.length < substring.length) {
return true;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also a fast path using indexOf?

Suggested change
if (substring.length === 0 || string.length < substring.length) {
return true;
}
if (substring.length === 0 || string.length < substring.length) {
return true;
}
if (string.indexOf(substring) !== -1) {
return true;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant