Giter VIP home page Giter VIP logo

Comments (4)

rechsteiner avatar rechsteiner commented on July 18, 2024

Hi @zllarry! Do you have any ways of reproducing this issue?

from parchment.

jaceklapinski avatar jaceklapinski commented on July 18, 2024

Hello @rechsteiner

I think i know how to do this, because i am facing similar issue right now.

Below flow to do reproduce:

  1. Add two view controllers into PagingViewController
  2. Go into second vc
  3. Call something to update second vc title ( self.title = "new title" ) - title need to be different then initial title
  4. Call pagingViewController.reloadMenu()
  5. Menu indicator will switch to first vc and all will be locked

I Can send you movie in private message if you need, just let me know.

Best !

from parchment.

rechsteiner avatar rechsteiner commented on July 18, 2024

Hi @jaceklapinski! Sorry for the late response. Are you using PagingIndexItem? If you want to change the title of the menu item, but keep the same identity, you probably need to use a custom PagingItem. PagingIndexItem uses the title as part of its Hashable implementation, which means it will be considered a new item when changing the title. This is why the menu will switch to the first view controller. If you were to provide a custom PagingItem with stable identifiers, it should work. You can take a look at the Icons example here for creating custom items.

That said, I think Parchment should handle reloadMenu a bit better here. When calling reloadMenu when the current paging item is removed (because the identity changed), we should probably remove the current content view as well. The way to achieve this today is to use reloadData, but I think it makes sense that reloadMenu does the same.

from parchment.

jaceklapinski avatar jaceklapinski commented on July 18, 2024

@rechsteiner i think i know where the problem is right now. And my previous assumptions was wrong

If viewController with Parchment is not visible for example I am on different tab in TabViewController and I am trying to change Parchment selected index using for example

func select(indexPath: IndexPath, animated: Bool)

It will block change pages. I made a small debug session and it looks like that problem is here:

Screenshot 2024-02-21 at 08 43 28

If Parchment is not visible and user try to change selected page line 67 is triggered then when I get back to Parchment and tap on menu line 91 block changes ...

Best !

from parchment.

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.