Fix multiselect issue with section field#2521
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughAdds Ctrl/Meta-key handling to the admin field builder click handler: Ctrl/Meta-click adds the clicked field's containing Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant UI as Field Builder UI
participant H as admin.js click handler
U->>UI: Click field (with/without modifiers)
UI->>H: onClick(event)
alt Ctrl or Meta pressed
H->>H: Locate clicked field's containing `ul`
H->>UI: Add class "frm-selected-field-group" to that `ul`
Note right of H#lightblue: Early return — skip normal clickAction
H-->>UI: Return
else No Ctrl/Meta
H->>UI: Proceed with normal clickAction
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
js/formidable-settings-components.js.mapis excluded by!**/*.map,!**/*.mapjs/formidable_dashboard.js.mapis excluded by!**/*.map,!**/*.map
📒 Files selected for processing (1)
js/src/admin/admin.js(1 hunks)
|
Hi @AbdiTolesa, |
Hi @lauramekaj1 I just created a separate issue for that: https://github.com/Strategy11/formidable-pro/issues/6029 |
@AbdiTolesa ok so I validated that the issue in this PR is fixed. Thank you! |
|
@AbdiTolesa Does this cover this comment? https://github.com/Strategy11/formidable-pro/issues/6029#issuecomment-3387004193 |
@truongwp The link takes to the issue created probably for the comment you were referring to, we are tracking that separately anyway. |
|
@AbdiTolesa If I click on the first field, then hold Shift and click on a field inside a section, it selects all fields in the form. Please see this screencast: Screen.Recording.2025-10-15.at.18.21.37.mov |
@truongwp We are tracking that issue separately: https://github.com/Strategy11/formidable-pro/issues/6017 |
truongwp
left a comment
There was a problem hiding this comment.
This looks good now. Thanks @AbdiTolesa!
|
@AbdiTolesa Please resolve the conflicts with the master branch so we can merge it. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
js/src/admin/admin.js (1)
5690-5694: Keep multi‑select UI in sync on Ctrl/Cmd clickYou add the class and return, but don’t call the existing multi‑select sync flow. The popup/controls won’t appear until a later action. Reuse the same path as group clicks by invoking syncAfterMultiSelect immediately.
Apply this minimal change:
- if ( e?.metaKey || e?.ctrlKey ) { - // Add the target to list of selected fields. - this.closest( 'ul' ).classList.add( 'frm-selected-field-group' ); - return; - } + if ( e?.metaKey || e?.ctrlKey ) { + // Add the target to list of selected fields and sync UI state. + const ul = this.closest( 'ul.frm_sorting' ) || this.closest( 'ul' ); + if ( ul ) { + ul.classList.add( 'frm-selected-field-group' ); + const count = jQuery( '.frm-selected-field-group' ).length || 1; + syncAfterMultiSelect( count ); + maybeHideFieldGroupMessage(); + } + return; + }Note: Ctrl/Cmd‑click deselect toggling is tracked in formidable-pro#6029 and can remain out of scope here. Please just verify the popup appears right after the first Ctrl/Cmd click.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
js/formidable-settings-components.js.mapis excluded by!**/*.map,!**/*.map
📒 Files selected for processing (1)
js/src/admin/admin.js(1 hunks)
truongwp
left a comment
There was a problem hiding this comment.
This looks good now. Thanks @AbdiTolesa!
|
Here's the code health analysis summary for commits Analysis Summary
|
Fix https://github.com/Strategy11/formidable-pro/issues/5229
Test steps
ctrl + clickon fields outside the Section and then try adding the Section field to the selected groups by clicking on the Section header.CleanShot.2025-10-01.at.16.26.33.mp4
CleanShot.2025-10-01.at.16.16.00.mp4