stride3d / stride3d/stride

EditText UI element IsSelectionActive throws object reference error

Open
#2,569 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release

Version: 4.2.0.2282

Platform(s): Windows

Describe the bug
When enabling and focusing a EditText UI element using IsSelectionActive = true, the error Object reference not set to an instance of an object is thrown. However, the EditText element seems to be responsive and accepts input anyway.

To Reproduce
Repro project: https://github.com/BlackCurtainStudio/Stride-EditTextSample

Expected behavior
No errors should occur.

Screenshots
Image

Log and callstacks
[EditTextSample.UiScript]: Error: Object reference not set to an instance of an object. [EditTextSample.UiScript]: Error: at Stride.Core.ServiceRegistryExtensions.GetSafeServiceAs[T](IServiceRegistry registry) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core\ServiceRegistryExtensions.cs:line 22 at Stride.UI.Controls.EditText.ActivateEditTextImpl() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.UI\Controls\EditText.Direct.cs:line 125 at Stride.UI.Controls.EditText.set_IsSelectionActive(Boolean value) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.UI\Controls\EditText.cs:line 160

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the linked Stride-EditTextSample on Windows, then inspect Stride.UI.Controls.EditText.Direct.cs at ActivateEditTextImpl and EditText.cs at the IsSelectionActive setter. Trace the service lookup shown in the call stack and verify that enabling selection no longer logs an object-reference error while the EditText remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.