Git Product home page Git Product logo

Comments (5)

meowgorithm avatar meowgorithm commented on July 17, 2024 2

Hi! So the list example was actually intended to have filtering disabled, but it looks like we accidentally left some of the filtering hooks in. We’ll remove it to keep the simple example simple.

That said, here is the simple list example with filtering enabled and here is the diff with the necessary changes. Basically, you just need to make sure the enter doesn't select an item while filtering and then you just need to make sure all messages pass through list’s Update function so filter matching messages will be processed.

On that note (and to your point, @jon4hz) list.filterMatchesMsg should probably be exposed so people can match on that message.


Edit: whoops, I totally missed your PR there, @jon4hz. That’s also a great example of how to do it.

from bubbletea.

jon4hz avatar jon4hz commented on July 17, 2024 1

FilterValue() must be defined in order to satisfy the Item interface defined here. For the filter to work properly, you'll have to update the list model if you receive a list.filterMatchesMsg tea command. Since this is a private struct, you have to catch the cmd in the default case.

from bubbletea.

souvikinator avatar souvikinator commented on July 17, 2024 1

Hey there! thanks for clarifying. So I was trying to update the list contents in View rather than Update. Now it's working, thanks for pointing out :)

from bubbletea.

jon4hz avatar jon4hz commented on July 17, 2024 1

@meowgorithm if you want filtered disabled in the simple-list example I'll close my PR. Exposing list.filterMatchesMsg is imo a cool idea.

from bubbletea.

muesli avatar muesli commented on July 17, 2024

Can't reproduce this anymore, the filter tooltip isn't showing up in list-simple. Thanks for the ticket, closing!

from bubbletea.

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.