question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] element.focus is not a function

See original GitHub issue

After select result I got many errors “Microsoft.JSInterop.JSException: element.focus is not a function” After that component stop working.

Blazor Server side.

<BlazoredTypeahead TItem="string" TValue="string" Value="SelectedFilm" ValueExpression="@(() => SelectedFilm)" ValueChanged="@(e => Console.WriteLine(e))" placeholder="Search..." Debounce="1000" SearchMethod="SearchFilms"> <SelectedTemplate> @context </SelectedTemplate> <ResultTemplate> @context </ResultTemplate> <NotFoundTemplate> Sorry, there weren't any search results. </NotFoundTemplate> <FooterTemplate> <button>Show more</button> </FooterTemplate> </BlazoredTypeahead>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chrissaintycommented, Jul 7, 2020

Thanks for the info @arivera12. I’m working on a very big update for Blazored Modal which should be out this week. Once I’m done with that I’m going to be working on the Typeahead.

1reaction
shaneconnollycommented, Jul 21, 2020

Thanks @needhelp33, I understand what you mean now. I’ve just realised that my issue was actually related to the fact that I was using the ValueChanged event instead of @bind-Value as per #124 and I hadn’t followed @osheab87’s advise here: https://github.com/Blazored/Typeahead/issues/124#issuecomment-632820208

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript: Focus is not a function - html
Your Forename variable is not holding a reference to a DOM element. It is referencing the .value of that element. The same is...
Read more >
Javascript: Focus is not a function
I'm writing a registration form and am trying to sort out some validation. I got this same problem when my validate button was...
Read more >
HTMLElement: focus() method - Web APIs | MDN
The HTMLElement.focus() method sets focus on the specified element, if it can be focused. The focused element is the element that will ...
Read more >
Focusing: focus/blur
Most elements do not support focus by default. Use tabindex to make anything focusable. The current focused element is available as document.
Read more >
Uncaught TypeError: this.nextSibling.focus is not a function
Hello, I've tried to focus an input element when I click on the span element (with " Username: " label) using this.nextSibling property...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found