Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Capture [SPACE] without jumping in Browser

$
0
0

I am using FluentUI for Blazor WASM in version 4.10.4.

I want to make my project navigatable by keyboard and I am using FluentUIs KeyCode to achieve this. The issue comes when trying to use the [SPACE] key. When I press it it is captured as desired (see code below) but also it is triggered the browsers default behavior (jumping in screen). I don't know how to disable the browsers default behavior when pressing [SPACE] key.

My code:

public async Task OnKeyDownAsync(FluentKeyCodeEventArgs args){    if (args.Key == KeyCode.Space)    {        _logger.LogInformation("[SPACE] pressed");    }}

How can I prevent the browsers default behavior (jumping in screen) when pressing the space-bar key? Is there maybe a way to achieve this when registering RegisterListener from injected IKeyCodeService?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>