Refactor/align selectionlist checkboxes#37402
Conversation
|
Maybe we should limit the touch handler for the Nagranie.z.ekranu.2024-02-28.o.12.02.53.mov |
|
cc @luacmartins |
Yup, I agree with that. |
I agree as well. |
|
Cool, this change will be implemented in all selection lists |
situchan
left a comment
There was a problem hiding this comment.
Looks good. Some minor feedback
| return rightHandSideComponent; | ||
| }; | ||
|
|
||
| const handleCheckboxPress = () => { |
There was a problem hiding this comment.
NAB:
use useCallback with item dependency.
or I think onPress={() => (onCheckboxPress ?? onSelectRow)(item)} is better without defining this function
| showTooltip={showTooltip} | ||
| canSelectMultiple={canSelectMultiple} | ||
| onSelectRow={() => selectRow(item)} | ||
| onCheckboxPress={onCheckboxPress ? () => onCheckboxPress?.(item) : undefined} |
There was a problem hiding this comment.
NAB:
| onCheckboxPress={onCheckboxPress ? () => onCheckboxPress?.(item) : undefined} | |
| onCheckboxPress={onCheckboxPress ? () => onCheckboxPress(item) : undefined} |
|
I don't feel too strongly whether or not that text is selectable... I'm fine with how it is right now. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
Thanks for the review. I'll go ahead and merge this since it unblocks further Simplified Collect development. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.45-0 🚀
|
| {canSelectMultiple && ( | ||
| <View | ||
| <PressableWithFeedback | ||
| accessibilityLabel={item.text} |
There was a problem hiding this comment.
a minor regression:
regression.mp4
we also need to pass disabled={isDisabled}? 🤔
There was a problem hiding this comment.
yes, I noticed that as well. Btw not blocker since admin cannot be actually removed.
Hope @ArekChr would fix it as follow-up along with my NAB feedback
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.45-6 🚀
|


This PR introduces an enhancement to the SelectionList by adding an additional press handler. This modification caters to scenarios where a different function is needed upon pressing a row.
Details
onCheckboxPressis defined, its handler is applied to the checkbox only.onCheckboxPressis not defined, its handler applies to the entire row.Check Desktop Web videos for both scenarios, as other platforms contain the first case
Fixed Issues
$ #37307
PROPOSAL:
Tests
Offline tests
QA Steps
the same as a test steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Scenario when
onCheckboxPressdefinedNagranie.z.ekranu.2024-02-28.o.12.06.25.mov
Android: mWeb Chrome
iOS: Native
Scenario when
onCheckboxPressdefinedNagranie.z.ekranu.2024-02-28.o.12.02.53.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Scenario with toggle function in 'onCheckboxPress' and navigation
onSelectRowNagranie.z.ekranu.2024-02-28.o.11.36.46.mov
Scenario with toggle function in 'onSelectRow'
Nagranie.z.ekranu.2024-02-28.o.11.36.46.mov
MacOS: Desktop
Nagranie.z.ekranu.2024-02-28.o.12.13.28.mov