Skip to content

[HxAutosuggest] Cannot read properties of null (reading 'focus') #1097

@petrhank

Description

@petrhank

Steps to Reproduce

  1. Type HxMessenger into the search input field
  2. Press Enter

Expected Behavior

  • The dropdown should close
  • The page should navigate to the HxMessenger page

Actual Behavior

  • The dropdown closes
  • The page does not navigate anywhere
  • Browser console outputs an error
  • The next Enter press triggers the navigation

Console Error

Full console output
blazor.web.js:1 Uncaught (in promise) Error: Microsoft.JSInterop.JSException: Cannot read properties of null (reading 'focus') 
TypeError: Cannot read properties of null (reading 'focus') 
    at Ki._completeHide (dropdown.js:212:19) 
    at Ki.hide (dropdown.js:168:10) 
    at Module.destroy (HxAutosuggest.o4oc6rt3ir.js:70:5) 
    at blazor.web.js:1:2900 
    at new Promise (<anonymous>) 
    at w.beginInvokeJSFromDotNet (blazor.web.js:1:2857) 
    at Object.jr [as invokeJSJson] (blazor.web.js:1:165356) 
    at dotnet.runtime.5nhp1wfg9b.js:3:33879 
    at Fc (dotnet.runtime.5nhp1wfg9b.js:3:172343) 
    at 00ade532:0x189d1 
    at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__16`1[[Microsoft.JSInterop.Infrastructure.IJSVoidResult, Microsoft.JSInterop, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext((index):1:1) 
    at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(/IJSObjectReference , String , Object[]) 
    at Havit.Blazor.Components.Web.Bootstrap.Internal.HxAutosuggestInternal`2.<DestroyDropdownAsync>d__156[[Havit.Blazor.Documentation.Shared.Components.SearchItem, Havit.Blazor.Documentation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null],[Havit.Blazor.Documentation.Shared.Components.SearchItem, Havit.Blazor.Documentation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext((index):1:1) 
    at Havit.Blazor.Components.Web.Bootstrap.Internal.HxAutosuggestInternal`2.<HandleInputKeyDown>d__150[[Havit.Blazor.Documentation.Shared.Components.SearchItem, Havit.Blazor.Documentation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null],[Havit.Blazor.Documentation.Shared.Components.SearchItem, Havit.Blazor.Documentation,]()]()

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions