Giter Club home page Giter Club logo

Comments (9)

marekrozmus avatar marekrozmus commented on May 28, 2024 1

@bastiengrignon I used your code, build an app with create-react-app, added chakra and tailwind and in my case everything is working OK:

KYmD6p1fki

There must be some other implementation issue that I cannot reproduce from the part of your code.

from react-swipeable-list.

bastiengrignon avatar bastiengrignon commented on May 28, 2024 1

@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.

marekrozmus avatar marekrozmus commented on May 28, 2024

I don't follow :) Could you please describe in more details?
How somebody could click while swiping item?

from react-swipeable-list.

bastiengrignon avatar bastiengrignon commented on May 28, 2024

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.

marekrozmus avatar marekrozmus commented on May 28, 2024

@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.

bastiengrignon avatar bastiengrignon commented on May 28, 2024

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.

marekrozmus avatar marekrozmus commented on May 28, 2024

This one is closed by Release v1.5.0

from react-swipeable-list.

marekrozmus avatar marekrozmus commented on May 28, 2024

@all-contributors please add @segersniels for ideas

from react-swipeable-list.

allcontributors avatar allcontributors commented on May 28, 2024

@marekrozmus

I've put up a pull request to add @segersniels! 🎉

from react-swipeable-list.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.