Code Monkey home page Code Monkey logo

Comments (9)

chrissainty avatar chrissainty commented on May 24, 2024

Thanks for reporting this @natsuo. Definitely something we need to get fixed!

from typeahead.

chrissainty avatar chrissainty commented on May 24, 2024

I think we need to establish the use cases for the footer/header templates. I can add a link to the footer template and I can click on the link without issue. Yes, the suggestion list then closes but I'm not sure why it should stay open.

@natsuo Could you clarify the type of behaviour you're after and maybe some context?

from typeahead.

natsuo avatar natsuo commented on May 24, 2024

This example shows header and footer templates. Footer has item count. Header has button to create a new product and a checkbox to toggle if disabled items should be shown in the list or not.

expected

Nothing happens if you click on any whitespace area. The suggestion list disappears only if you click on a suggestion item, or outside the window.

from typeahead.

chrissainty avatar chrissainty commented on May 24, 2024

Ok, thanks for the reply. I don't think this is going to be easily resolved, I'll need to have a think. The mechanism for closing the suggestion list works by focus being lost on the underlying input control. This means we don't have to resort to JavaScript interop.

At the moment I think to get the behavior you're after we would need to do a lot more JavaScript interop, which I'd prefer to not do if we can help it. Leave it with me and I'll see what I can come up with.

from typeahead.

vertonghenb avatar vertonghenb commented on May 24, 2024

Maybe this is something we can easily fix with the new Blazor version (3.1 p2+)
Stop event propagation in Blazor apps
https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-1-preview-2/

This could also clean-up the last real interop code addKeyDownEventListener.

from typeahead.

chrissainty avatar chrissainty commented on May 24, 2024

You might be right @vertonghenb. Do you want to have a go at this one? If not I'll code it up when I get a chance.

from typeahead.

chrissainty avatar chrissainty commented on May 24, 2024

@vertonghenb I've tried using the new prevent default directive but no joy at all. It no effect. I put a prevent default on every event and still nothing was blocked.

from typeahead.

vertonghenb avatar vertonghenb commented on May 24, 2024

@chrissainty Hehe, I tried the exact same thing but no luck, well it worked in the standalone example. But the validation while using it in a form messes things up.

from typeahead.

chrissainty avatar chrissainty commented on May 24, 2024

I'm doing some housekeeping. Looking back at this issue now it seems like we need to take some more aggressive steps to keep the suggestion list open after clicking on a header or footer link.

Personally, I'm not sure it's something we should look to do right now. As I mentioned before I think this would involve a lot more JS and I'm not sure of the demand for this feature. Based on all this I'm going to close this issue for now. But please reopen if anyone feels this needs more discussion/attention.

from typeahead.

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.