Comments (9)
@bastiengrignon I used your code, build an app with create-react-app, added chakra and tailwind and in my case everything is working OK:
There must be some other implementation issue that I cannot reproduce from the part of your code.
from react-swipeable-list.
@marekrozmus Ok you're right it was an action in the onChange
of my Switch that was doing this kind of behavior.
Thanks for your quick response ! 😉
from react-swipeable-list.
I don't follow :) Could you please describe in more details?
How somebody could click while swiping item?
from react-swipeable-list.
I've got the same issue with this SwipeableList
!
Sometimes I need to click multiple times on my switch to be able to toggle it. If I don't use the SwipeableList
my Switch is working fine, it toggle instantly when I click on it.
Here is a video of what's going on :
video-1640122475.mp4
from react-swipeable-list.
@bastiengrignon Could you tell me what kind of component/library are you using for this switcher? Or even better provide some code so I can see how it is built?
from react-swipeable-list.
I'm using Chakra UI for the Switch
component
Here is a part of my code of list of alarms :
<SwipeableList fullSwipe={ true } style={ { backgroundColor: 'transparent' } } type={ ListType.IOS }>
{
alarms.map((alarm) => (
<SwipeableListItem fullSwipe={ true } trailingActions={ trailingActions(alarm) } key={ uuidv4() }>
<div
className="flex justify-between items-center p-2 m-2 bg-sky-200 w-full rounded-xl shadow-md">
<div>
<div className="flex items-center space-x-3">
<div className={ `text-4xl ${ textColor } space-x-1` }>
<span>{ alarm.hour }</span><span>:</span><span>{ alarm.minute }</span>
</div>
<div className="text-xl">
<SunIcon color={ alarm.lights ? 'yellow.500' : 'gray.500' }/>
</div>
</div>
<div className="flex items-center space-x-2 h-4">
<Weekdays weekdays={ alarm.weekdays }/>
</div>
</div>
<Switch size="lg" defaultChecked={ alarm.activation }
onChange={ (event) => updateAlarmState(alarm, event) }/>
</div>
</SwipeableListItem>
))
}
</SwipeableList>
If I comment the <SwipeableListItem/>
, I can toggle my switch by pressing it only once as it should 😉
from react-swipeable-list.
This one is closed by Release v1.5.0
from react-swipeable-list.
@all-contributors please add @segersniels for ideas
from react-swipeable-list.
I've put up a pull request to add @segersniels! 🎉
from react-swipeable-list.
Related Issues (20)
- _this.trailingFullSwipeAction is not a function HOT 2
- Compatibility issue with newer Chromium HOT 6
- Is it possible to track the swipe direction? HOT 4
- Delay on LeadingAction HOT 5
- Does not work with react-awesome-dnd HOT 7
- React does not recognize the x... HOT 1
- Don't work in localhost with IOS twoaction button but work in codesandbox HOT 8
- SwipeableListItem onClick action triggered, when element swiped HOT 4
- Provide a way to click / touch an opened item, toggle all other items to close, including itself HOT 7
- onSwipeStart only called once per element HOT 3
- Max percentage swipable HOT 4
- trailingFullSwipeAction error every time I attempt to trigger a trailing swipe HOT 1
- [Feature Request] allow to pass react fragments or insert react nodes between list items HOT 3
- maxSwipe is not optional HOT 4
- incomplete closure of swipes HOT 1
- Several actions open if opened after deletion HOT 3
- Wrong counting for React.Children in TrailingActions HOT 2
- Warning: React does not recognize the X prop on a DOM element HOT 1
- Swiping is not working as expected HOT 1
- Alternatively, would it be possible for you to provide a reset API that would allow us to manually close the `<SwipeableListItem>` components? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-swipeable-list.