Skip to content

feat(ListItem): add onSwipeBegin and onSwipeEnd handlers & resetCallback - #3180

Merged
arpitBhalla merged 5 commits into
react-native-elements:nextfrom
arpitBhalla:swipeable
Feb 12, 2022
Merged

feat(ListItem): add onSwipeBegin and onSwipeEnd handlers & resetCallback#3180
arpitBhalla merged 5 commits into
react-native-elements:nextfrom
arpitBhalla:swipeable

Conversation

@arpitBhalla

@arpitBhalla arpitBhalla commented Aug 23, 2021

Copy link
Copy Markdown
Member

Feat:

  • onSwipeBegin (direction: 'left' | 'right') => any; & onSwipeEnd
  • Disable swipe if no content
  • resetCallBack reset to neutral position
 leftContent={(reset) => (
          <Button
            title="Info"
            onPress={() => reset()}
            icon={{ name: 'info', color: 'white' }}
            buttonStyle={{ minHeight: '100%' }}
          />
        )}

@netlify

netlify Bot commented Aug 23, 2021

Copy link
Copy Markdown

✔️ Deploy Preview for react-native-elements ready!

🔨 Explore the source changes: 19aa082

🔍 Inspect the deploy log: https://app.netlify.com/sites/react-native-elements/deploys/61c4c7901a22040007ab73e9

😎 Browse the preview: https://deploy-preview-3180--react-native-elements.netlify.app

@arpitBhalla
arpitBhalla force-pushed the swipeable branch 2 times, most recently from 83ebac9 to 9aea5b9 Compare August 28, 2021 17:02
@codecov

codecov Bot commented Aug 28, 2021

Copy link
Copy Markdown

Codecov Report

Merging #3180 (71f5e86) into next (217f623) will decrease coverage by 0.46%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #3180      +/-   ##
==========================================
- Coverage   79.25%   78.79%   -0.47%     
==========================================
  Files          88       88              
  Lines        1697     1707      +10     
  Branches      740      748       +8     
==========================================
  Hits         1345     1345              
- Misses        347      357      +10     
  Partials        5        5              
Impacted Files Coverage Δ
packages/base/src/ListItem/ListItem.Accordion.tsx 8.69% <ø> (ø)
packages/base/src/ListItem/ListItem.Swipeable.tsx 5.66% <0.00%> (-1.32%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 217f623...71f5e86. Read the comment docs.

@arpitBhalla
arpitBhalla deleted the swipeable branch December 20, 2021 07:38
@arpitBhalla
arpitBhalla restored the swipeable branch December 20, 2021 08:34
@arpitBhalla arpitBhalla reopened this Dec 20, 2021
@arpitBhalla
arpitBhalla marked this pull request as draft December 24, 2021 17:36
@arpitBhalla arpitBhalla changed the title [ListItem] Add onSwipeBegin and onSwipeEnd feat(ListItem): add onSwipeBegin and onSwipeEnd handlers Jan 25, 2022
@arpitBhalla
arpitBhalla marked this pull request as ready for review February 12, 2022 18:27
@arpitBhalla arpitBhalla changed the title feat(ListItem): add onSwipeBegin and onSwipeEnd handlers feat(ListItem): add onSwipeBegin and onSwipeEnd handlers & resetCallback Feb 12, 2022
@arpitBhalla
arpitBhalla merged commit 2a5a8b0 into react-native-elements:next Feb 12, 2022
@arpitBhalla
arpitBhalla deleted the swipeable branch February 12, 2022 19:49
@jorgegvallejo

Copy link
Copy Markdown
Contributor

Probably good to add the example to the docs.

Thanks for this feature!

@arpitBhalla

Copy link
Copy Markdown
Member Author

Would you like to create a PR?

@jorgegvallejo

jorgegvallejo commented Mar 22, 2022

Copy link
Copy Markdown
Contributor

Ok, I've submitted a PR for the docs update
#3410

edit: the corrected PR #3411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ListItem.Swipeable onSwipe method? ListItem Swipeable close swipeable view and disable swipe leftContent or rightContent

2 participants