The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
TextBox does not accept new text when focus is gained from a different window RRS feed

  • Question

  • I have found that when a textbox gains focus at the same time as the UWP application window and after another textbox in that window has focus, the textbox does not allow new text to be entered.

    With a new UWP blank application, add two textboxes to the MainPage:

    <Page
        x:Class="TextBoxFocusTestApp.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:TextBoxFocusTestApp"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    
        <StackPanel>
            <TextBox/>
            <TextBox/>
        </StackPanel>
    </Page>


    Start the application, set focus on the first text box, then change focus to another window, and then click on the second text box and try to type. No new text can be entered, though backspace and delete seem to work.

    Windows Version: 1803
    OS Build 17134.345
    Target SDK: 17134
    Min SDK: 15063

    • Edited by BlankMatt Saturday, November 10, 2018 12:47 AM
    • Changed type BlankMatt Monday, November 19, 2018 9:44 PM
    Saturday, November 10, 2018 12:42 AM

All replies

  • Hello BlankMatt,

    Now 1809 released, can you update your SDK and windows to see if the problem persist?

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 26, 2018 9:57 AM
  • Thanks for your reply Barry. I tested this on 1809 with the latest 1809 SDK and the problem still exists.

    Windows Version: 10.0.17763

    Here's my full Visual Studio 'About' Info:

    Microsoft Visual Studio Professional 2017  (Pro)
    Version 15.9.3
    VisualStudio.15.Release/15.9.3+28307.145
    Microsoft .NET Framework
    Version 4.7.03190

    Installed Version: Professional

    Visual C++ 2017   00369-60000-00001-AA447
    Microsoft Visual C++ 2017

    Application Insights Tools for Visual Studio Package   8.14.11009.1
    Application Insights Tools for Visual Studio

    ASP.NET and Web Tools 2017   15.9.04012.0
    ASP.NET and Web Tools 2017

    C# Tools   2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
    C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

    Common Azure Tools   1.10
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

    Extensibility Message Bus   1.1.49 (remotes/origin/d15-8@ee674f3)
    Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

    JavaScript Language Service   2.0
    JavaScript Language Service

    JavaScript Project System   2.0
    JavaScript Project System

    JavaScript UWP Project System   2.0
    JavaScript UWP Project System

    Microsoft JVM Debugger   1.0
    Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

    Microsoft MI-Based Debugger   1.0
    Provides support for connecting Visual Studio to MI compatible debuggers

    Microsoft Visual C++ Wizards   1.0
    Microsoft Visual C++ Wizards

    Microsoft Visual Studio VC Package   1.0
    Microsoft Visual Studio VC Package

    MLGen Package Extension   1.0
    MLGen Package Visual Studio Extension Detailed Info

    Mono Debugging for Visual Studio   4.13.11-pre (400cfb1)
    Support for debugging Mono processes with Visual Studio.

    NuGet Package Manager   4.6.0
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    ProjectServicesPackage Extension   1.0
    ProjectServicesPackage Visual Studio Extension Detailed Info

    ResourcePackage Extension   1.0
    ResourcePackage Visual Studio Extension Detailed Info

    ResourcePackage Extension   1.0
    ResourcePackage Visual Studio Extension Detailed Info

    TypeScript Tools   15.9.20918.2001
    TypeScript Tools for Microsoft Visual Studio

    Visual Basic Tools   2.10.0-beta2-63501-03+b9fb1610c87cccc8ceb74a770dba261a58e39c4a
    Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

    Visual F# Tools 10.2 for F# 4.5   15.8.0.0.  Commit Hash: 6e26c5bacc8c4201e962f5bdde0a177f82f88691.
    Microsoft Visual F# Tools 10.2 for F# 4.5

    Visual Studio Code Debug Adapter Host Package   1.0
    Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

    Visual Studio Tools for CMake   1.0
    Visual Studio Tools for CMake

    Visual Studio Tools for Universal Windows Apps   15.0.28301.59
    The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

    VisualStudio.Mac   1.0
    Mac Extension for Visual Studio

    Xamarin   4.12.3.73 (d15-9@20b35b881)
    Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

    Xamarin Designer   4.16.5 (6b9f32067)
    Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    Xamarin Templates   1.1.127 (e975299)
    Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

    Xamarin.Android SDK   9.1.0.38 (HEAD/61d16aa23)
    Xamarin.Android Reference Assemblies and MSBuild support.

    Xamarin.iOS and Xamarin.Mac SDK   12.2.1.11 (5ef73d3)
    Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

    Monday, December 10, 2018 9:03 PM
  • @BlankMatt,

    Well I seems cannot reproduce this issue on 1809. What do you mean by saying "change focus to another window"? Click other window outside your app and switch back?

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 14, 2018 3:14 AM
  • Here is a github project with a source project as well as a gif of the issue. The second time the second textbox takes focus I am attempting to type alpha-numeric input into it. The backspace key does work as expected. To reproduce I simply clicked on the desktop and then clicked on the second text box.

    https://github.com/billowing-in-the-wind/TextBoxFocusBug/tree/master


    • Edited by BlankMatt Friday, December 14, 2018 11:37 PM
    Friday, December 14, 2018 11:09 PM
  • I also have this issue, UWP targeting build 1809, running 1903. Also occurs targeting 1903.

    Steps:

    1. Have a couple text boxes

    2. Give focus somewhere else in your app (I have a listbox that does stuff on double tap)

    3. Click on the desktop

    4. Click directly on the text box. If you give another control in the app focus and then the text box, the bug does not appear

    Type whatever you want, the text box will remain blank even though it both shows the blue "focus" highlight and has a blinking cursor. Note that this doesn't seem to be an issue if the textbox already has text in it.


    • Edited by BradleyDotNet Thursday, August 29, 2019 2:25 AM Updated info
    Thursday, August 29, 2019 2:22 AM
  • This problem still exists, running 1909.
    Friday, December 6, 2019 10:12 PM