Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Clicking on footer template closes suggestion list #66

Closed
natsuo opened this issue Oct 26, 2019 · 9 comments
Closed

Clicking on footer template closes suggestion list #66

natsuo opened this issue Oct 26, 2019 · 9 comments
Labels
Bug Something isn't working Needs: Design The issues needs design work before implementing

Comments

@natsuo
Copy link
Contributor

natsuo commented Oct 26, 2019

Clicking on the footer template, or any of the elements inside the footer template causes the component to close the suggestion list.

The footer template can be used in a variety of ways, including:

  • Showing suggestion/item count.
  • Showing a label with a description or help.
  • Showing a link/logo to the service providing the suggestions (like weather service provider).

Clicking outside the list entirely should obviously close the suggestions list.

@chrissainty
Copy link
Member

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

@chrissainty chrissainty added the Bug Something isn't working label Oct 26, 2019
@chrissainty chrissainty added Needs: Investigation The issues needs investigation before implementing and removed Bug Something isn't working labels Oct 28, 2019
@chrissainty
Copy link
Member

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?

@natsuo
Copy link
Contributor Author

natsuo commented Oct 29, 2019

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.

@chrissainty
Copy link
Member

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.

@chrissainty chrissainty added the Needs: Design The issues needs design work before implementing label Oct 30, 2019
@vertonghenb
Copy link
Contributor

vertonghenb commented Nov 18, 2019

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.

@chrissainty
Copy link
Member

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.

@chrissainty
Copy link
Member

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

@vertonghenb
Copy link
Contributor

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

@vertonghenb vertonghenb added Bug Something isn't working and removed Needs: Investigation The issues needs investigation before implementing labels Jan 3, 2020
@chrissainty
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Needs: Design The issues needs design work before implementing
Projects
None yet
Development

No branches or pull requests

3 participants