-
Notifications
You must be signed in to change notification settings - Fork 4k
[Fix] Disabled widgets show border when showWidgetBorder=true
#12949
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
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
ebec38b to
f064691
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds dynamic border color styling to input widgets based on their focus state. When an input is focused, its border changes to the primary theme color, providing better visual feedback to users.
Key changes:
- Converted static style objects to style functions that receive
$isFocusedstate - Added dynamic border color logic that switches between widget border color and primary color on focus
- Applied this pattern consistently across multiple input widget components
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| TimeInput.tsx | Added focus-based border color styling to the ControlContainer override |
| TextInput.tsx | Added focus-based border color styling to the Root override |
| TextArea.tsx | Added focus-based border color styling to the Root override |
| Multiselect.tsx | Added focus-based border color styling to the ControlContainer override |
| DateInput.tsx | Added focus-based border color styling to the Root override of the Input component |
| Selectbox.tsx | Added focus-based border color styling to the ControlContainer override |
sfc-gh-bnisco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the screenshots, they look great! A few broader questions/suggestions:
- suggestion: This should have some tests for this functionality.
- question: Are there any other widgets that need to be updated or do we expect this PR to encompass all widgets that require this logic?
- question: Looking forward, if we were to introduce a new widget that also needs this visual styling logic, how can we ensure it gets this? Ideally, we'd have some type of automated system/reusable component that enforces this so we aren't reliant on internal knowledge of expected behavior.
e944690 to
84d5d55
Compare
I kept trying to find a way to cover this in unit tests, but begrudgingly have to do e2e snapshot test (due to dynamic styling of these Baseweb components)
This should cover the necessary updates, the other widgets (
Makes sense, at this point I don't have a clear idea of how to implement an overarching component given some of these are baseweb components and others our own styled components (but not all are |
sfc-gh-bnisco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the revisions and for your thoughtful answers to my questions/suggestions. LGTM!
| // Helper function to handle the border color for baseweb input widgets | ||
| // @see Selectbox, Multiselect, DateInput, TimeInput, TextInput, TextArea, NumberInput |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: These should be formatted as JSDoc comments for better IDE/tooling integration
📉 Frontend coverage change detectedThe frontend unit test (vitest) coverage has decreased by 0.0500%
💡 Consider adding more unit tests to maintain or improve coverage. |
Describe your changes
Fix widget border display when
showWidgetBorder=truefor disabled widgets. The following were updated:st.selectboxst.multiselectst.date_inputst.time_inputst.text_inputst.text_areaCurrent: only some widgets are correct (ex: audio input)

After:

Testing Plan