Giter VIP home page Giter VIP logo

Comments (8)

philo23 avatar philo23 commented on May 16, 2024 1

Just fixed my previous comment, looks like GitHub markdown was eating some of the < /> tags... hopefully it should make a bit more sense now! Basically it seems like <TouchableHighlight /> isn't firing off the onPressOut callback to un-highlight the row when you mess with the children of the <Section> presumably because somethings getting unmounted midpress? Not sure.

And I can definitely see the same issue on my iOS simulator, it's where I first noticed it. Let me try re-running that snack on my device though.

Edit: Yep, its still missing there.

from react-native-tableview-simple.

Purii avatar Purii commented on May 16, 2024 1

Good to hear!

Feel free to close this issue if it works for you now πŸ‘

from react-native-tableview-simple.

Purii avatar Purii commented on May 16, 2024

Hi @philo23!

Glad that you like it!

That's an interesting issue. Could be something with this rows: https://github.com/Purii/react-native-tableview-simple/blob/master/src/components/Section.tsx#L128-L140

It may take some time before I can take a closer look. If you find a solution in the meantime feel free to open a PR πŸ‘

from react-native-tableview-simple.

philo23 avatar philo23 commented on May 16, 2024

So I've done a little digging and it seems like highlightedRowIndex isn't getting reset back to undefined by unhighlightRow because the onPressOut callback isn't being fired from the <TouchableHighlight> used inside of the <Cell> component.

It's almost like <TouchableHighlight> is being unmounted or something before it gets a chance to call the onPressOut callback? but I'm not sure because that doesn't seem like it should work like that.

At first I thought it might be this line,

if (highlightedRowIndex) return;
or line 66 because highlightedRowIndex could be set to index 0 or 1, but as far as I can tell it's not actually that. Though I'd be curious to find out why those checks are in there.

from react-native-tableview-simple.

Purii avatar Purii commented on May 16, 2024

Yep. Just saw that.
Happened on my rewrite to TS... but that's not released yet.

Tried to verify the issue with a local simulator. But there it works?

from react-native-tableview-simple.

Purii avatar Purii commented on May 16, 2024

Seems to be some kind of race condition.
For me it works with the Snack and locally...

Looks like component doesn't get rerendered if the children change.
The Touchable triggers an update of highlightedRowIndex which leads to a serenader of the Section. That's why it works after pressing the Touchable Component.

Section:127-132 controls the rendering of the Separator. Could you try out to debug the conditions?

Edit: Just released v3.0.0 with the TS Component. Best you update, so we have the same version.

from react-native-tableview-simple.

philo23 avatar philo23 commented on May 16, 2024

Great, I was just about to ask what the best way to try out the new TS version. I'll test out v3.0.0 now and let you know how it goes.

from react-native-tableview-simple.

philo23 avatar philo23 commented on May 16, 2024

I've updated it and it appears to be working now in-simulator, but I think the actual issue might have been that my react-native dependency was actually out of date by a couple of minor versions πŸ˜…

Weirdly the snack from earlier still seems to be broken even with the new v3 version... but I think this bug can probably be put down to something in React Native thats since been fixed!

from react-native-tableview-simple.

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.