Toolbelt.Blazor.HotKeys2 icon indicating copy to clipboard operation
Toolbelt.Blazor.HotKeys2 copied to clipboard

Example not working

Open Martin-Andersen opened this issue 2 years ago • 5 comments

In the old version of HotKeys. I wrote this

HotKeysContext = HotKeys.CreateContext()
                .Add(ModKeys.Ctrl, Keys.K, SetFocusInGridSearchField, "Set focus in grid search field");

I tried this in v2, not working

HotKeysContext = HotKeys.CreateContext()
            .Add(ModCode.Ctrl,Key.k, SetFocusInGridSearchField, "Set focus in grid search field");

And this not working

HotKeysContext = HotKeys.CreateContext()
            .Add(ModCode.Ctrl,Key.k, "Set focus in grid search field", _ => SetFocusInGridSearchField);

Is it because my handler is async?

private async Task SetFocusInGridSearchField()
    {
        await JsRuntime.InvokeVoidAsync("focusElement", GridSearchBoxPortfolioListGrid);
    }

Martin-Andersen avatar Feb 06 '23 13:02 Martin-Andersen