Skip to content

fix #13624 DemoConsole app: An exception pops up when focusing on "Type Here" in contextMenuStrip under DarkMode #13635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Epica3055
Copy link
Member

@Epica3055 Epica3055 commented Jun 20, 2025

Fix #13624

Root cause

When in DarkMode we use ToolStripSystemDarkModeRenderer do the rendering work.

Type here is not an actual ToolStripItem, so the null value pass to ToolStripArrowRenderEventArgs

image

So not only in DarkMode, but also in normal color mode, e.Item in DrawArrow is null, but the DrawArrow method of ToolStripRenderer makes a null judgment on e.Item, while ToolStripRenderer.cs does not, so this problem occurs.

Proposed changes

  • Add null check like we did here

Before

Image

Exception.mp4

After

no Exception

Test methodology

  • manual test
Microsoft Reviewers: Open in CodeFlow

…on "Type Here" in contextMenuStrip under DarkMode
@Epica3055 Epica3055 requested a review from a team as a code owner June 20, 2025 09:19
@github-actions github-actions bot added the area-DarkMode Issues relating to Dark Mode feature label Jun 20, 2025
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.60341%. Comparing base (08485db) to head (753da08).
Report is 8 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13635         +/-   ##
===================================================
- Coverage   76.60828%   76.60341%   -0.00487%     
===================================================
  Files           3253        3253                 
  Lines         640996      640995          -1     
  Branches       47439       47439                 
===================================================
- Hits          491056      491024         -32     
- Misses        146290      146321         +31     
  Partials        3650        3650                 
Flag Coverage Δ
Debug 76.60341% <0.00000%> (-0.00487%) ⬇️
integration 18.98972% <0.00000%> (-0.00413%) ⬇️
production 51.05805% <0.00000%> (-0.01096%) ⬇️
test 97.41175% <ø> (ø)
unit 48.43629% <0.00000%> (-0.01061%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeafShi1
Copy link
Member

Please add Root Cause in the description

@LeafShi1 LeafShi1 closed this Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DarkMode Issues relating to Dark Mode feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DemoConsole app: An exception pops up when focusing on "Type Here" in contextMenuStrip under DarkMode
2 participants