-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Refactor/align selectionlist checkboxes #37402
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 |
ef05293
to
41bb772
Compare
41bb772
to
2e1472b
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.
LGTM
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.
Looks good. Some minor feedback
@@ -43,6 +44,14 @@ function BaseListItem<TItem extends ListItem>({ | |||
return rightHandSideComponent; | |||
}; | |||
|
|||
const handleCheckboxPress = () => { |
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.
NAB:
use useCallback
with item
dependency.
or I think onPress={() => (onCheckboxPress ?? onSelectRow)(item)}
is better without defining this function
@@ -289,6 +289,7 @@ function BaseSelectionList<TItem extends ListItem>( | |||
showTooltip={showTooltip} | |||
canSelectMultiple={canSelectMultiple} | |||
onSelectRow={() => selectRow(item)} | |||
onCheckboxPress={onCheckboxPress ? () => onCheckboxPress?.(item) : undefined} |
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.
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 🚀
|
@@ -66,8 +75,10 @@ function BaseListItem<TItem extends ListItem>({ | |||
<> | |||
<View style={wrapperStyle}> | |||
{canSelectMultiple && ( | |||
<View | |||
<PressableWithFeedback | |||
accessibilityLabel={item.text} |
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.
a minor regression:
regression.mp4
we also need to pass disabled={isDisabled}
? 🤔
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.
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
onCheckboxPress
is defined, its handler is applied to the checkbox only.onCheckboxPress
is 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Scenario when
onCheckboxPress
definedNagranie.z.ekranu.2024-02-28.o.12.06.25.mov
Android: mWeb Chrome
iOS: Native
Scenario when
onCheckboxPress
definedNagranie.z.ekranu.2024-02-28.o.12.02.53.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Scenario with toggle function in 'onCheckboxPress' and navigation
onSelectRow
Nagranie.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