feat: add dataPreventOutsideClick prop to reafactor: ComboboxOptions for enhanced click handling
Description
This PR adds dataPreventOutsideClick in combobox option props
Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [x] Improvement (change that would cause existing functionality to not work as expected)
- [ ] Code refactoring
- [ ] Performance improvements
- [ ] Documentation update
Screenshots and Media (if applicable)
Summary by CodeRabbit
- New Features
- Added optional outside-click prevention configuration to the Combobox component, enabling control over whether the options dropdown closes when users interact outside the menu.
Walkthrough
A new optional dataPreventOutsideClick boolean prop is added to ComboboxOptionsProps. The prop is accepted by the ComboboxOptions component and forwarded to the Popup component as the data-prevent-outside-click DOM attribute, enabling outside-click prevention behavior configuration.
Changes
| Cohort / File(s) | Summary |
|---|---|
ComboBox outside-click prevention packages/propel/src/combobox/combobox.tsx |
Added optional dataPreventOutsideClick?: boolean prop to ComboboxOptionsProps interface; wired prop to forward as data-prevent-outside-click attribute on BaseCombobox.Popup component |
Estimated code review effort
๐ฏ 2 (Simple) | โฑ๏ธ ~8 minutes
- Verify TypeScript interface addition is syntactically correct and properly typed
- Confirm prop is correctly forwarded from component props to the
Popupelement's data attribute - Check that optional prop maintains backward compatibility with existing usage
Poem
๐ฐ A little prop hops into view, Preventing clicks from sneaking through, The ComboBox now knows the way, To keep outside guests at bay! ๐ชโจ
Pre-merge checks and finishing touches
โ Failed checks (1 warning, 1 inconclusive)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | โ ๏ธ Warning | The description provides a basic overview but is incomplete; the author selected 'Improvement' instead of 'Feature', left most template sections empty, and provided no test scenarios, screenshots, or references despite the template requiring them. | Complete the description by: clarifying why this is a Feature not an Improvement, adding test scenarios explaining how the new prop was tested, and providing any related issue references or documentation. |
| Title check | โ Inconclusive | The title contains a typo ('reafactor' instead of 'refactor') and is somewhat convoluted with unclear phrasing about 'reafactor: ComboboxOptions', making it less clear than it should be. | Simplify to: 'feat: add dataPreventOutsideClick prop to ComboboxOptions' or similar, fixing the typo and removing confusing language. |
โ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | โ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
refactor/combox-outside-click
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.