Skip to content

Issue with focusing element with .focus() #10016

Open

Description

Using Blazor Maui to focus an input after a button click. The same code works fine in a basic HTML file just not in Blazor Maui.
Issue: The element will be focused and receive focus but will not show the on screen keyboard.

Here is the javascript code...
function focusElement(elementId) { document.getElementById(elementId).focus(); }

This is referenced in the index.html file like so...
<script type="text/javascript" src="js/app-helpers.js"></script>

and here is the input being focused...
<input type="text" id="potato" placeholder="Enter text...">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Priority: 2area-blazorBlazor Hybrid / Desktop, BlazorWebViewdiscussedCreated by mkArtakMSFT to help with planning temporarily. It will be removed after planning is done.investigates/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions