-
Notifications
You must be signed in to change notification settings - Fork 40
fix: Prevent StyledWidgets
from being focusable by default
#551
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
canRequestFocus
property on InteractiveMixStateWidget
StyledWidgets
from being focusable by default
🧩 Analysis chain🏁 Script executed:
Length of output: 1459 🏁 Script executed:
Length of output: 13689 🏁 Script executed:
Length of output: 32874 @tilucasoli Based on my analysis of the PR, I can see you've implemented a fix to prevent The key changes include:
These changes make the behavior more intuitive and match users' expectations from regular Flutter widgets. The implementation looks solid and well-tested. Would you like me to review anything specific in the PR? ✅ Actions performedReview triggered.
|
WalkthroughThe changes update the widget focus behavior. A new boolean flag, Changes
Sequence Diagram(s)sequenceDiagram
participant SB as SpecBuilder
participant I as Interactable
participant IS as _InteractiveStateBuilder
participant EX as ExcludeFocus
participant FAD as FocusableActionDetector
SB->>SB: Check style variants for focus
SB->>I: Pass calculated canRequestFocus flag
I->>IS: Build widget state with focus setting
IS->>EX: Wrap FocusableActionDetector (excluding = !canRequestFocus)
EX->>FAD: Initialize focus actions
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🔇 Additional comments (8)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
By default, all
StyledWidgets
are focusable, even in cases where they shouldn’t be. In vanilla Flutter, aContainer
is not focusable unless explicitly wrapped with another widget to enable focus. This PR aims to replicate that behavior inStyledWidgets
, making them focusable only when aFocusableVariant
is explicitly defined in their style. This change alignsStyledWidgets
with expected Flutter behavior, providing better control over focusable elements.Changes
canRequestFocus
property on Interactive;canRequestFocus
when neededReview Checklist
Summary by CodeRabbit
New Features
Tests