dotnet / dotnet/wpf

WPF should not show the touch keyboard for read-only fields

Open
#1,133 6 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: 4.7.1+
* Windows version: (`winver`): RS1+
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

**Problem description:**
WPF uses direct calls to `InputPane.TryShow` via `TipTsfHelper` when the focused control implements the text UIA pattern, UIA is already loaded, and if the OS is >= RS1.
This means that even if the exposed `TextPattern` is marked read-only, WPF will request the KB to show.

What is actually needed is a finer grained set of conditions.
* Don't call TryShow if the `TextPattern` implementation declares it is read-only
* Don't call TryShow if the focus tracking for the touch KB does not use UIA, but uses TSF (RS3+, but this needs confirmation).

This can be mitigated in later OSes (RS3+) by setting the AppContext flag `DisableImplicitTouchKeyboardInvocation`. This stops WPF from calling `InputPane.TryShow` but the KB focus tracking and invocation will still work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.