Skip to content

RichTextBox always sends its entire contents as an accessibility event on focus. #12772

@trypsynth

Description

@trypsynth

.NET version

DotNet 9.0

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

If I create a RichTextBox, alt+tab away from the window, and alt+tab back, both JAWS and NVDA report the entire contents of the RichTextBox as its own accessibility event. This is not standard behavior.
Oddly enough, narrator is not effected, reading nothing at all when the control takes focus.
Form1.cs:

namespace RichEditTest;

public class Form1 : Form {
	private RichTextBox textBox;

	public Form1() {
		this.Text = "RichEdit Test";
		this.Width = 450;
		this.Height = 250;
		textBox = new RichTextBox();
		textBox.AccessibleName = "Content";
		textBox.Text = "This is a test\r\nthat spans multiple\r\nlines.";
		textBox.Size = new Size(400, 200);
		textBox.Location = new Point(10, 10);
		this.Controls.Add(textBox);
	}
}

Program.cs

namespace RichEditTest;

static class Program
{
    /// <summary>
    ///  The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        // To customize application configuration such as set high DPI settings or default font,
        // see https://aka.ms/applicationconfiguration.
        ApplicationConfiguration.Initialize();
        Application.Run(new Form1());
    }    
}

Steps to reproduce

  1. Run the provided code with NVDA or JAWS active.
  2. Alt+tab away from the window and back.
  3. Note that the entire content gets read, not just the currently focused line. Seemingly it's being sent as its own accessibility event.

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions