BeginMenu: Fixed a bug where SetNextWindowXXX data before a BeginMenu() would not be cleared when the menu is not open. (#3030)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 765b81d..4b2c1b2 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -40,6 +40,8 @@
   branch pressing arrow keys while dragging a window from a tab could trigger an assert. (#3025)
 - ColorButton: Added ImGuiColorEditFlags_NoBorder flag to remove the border normally enforced
   by default for standalone ColorButton.
+- BeginMenu: Fixed a bug where SetNextWindowXXX data before a BeginMenu() would not be cleared
+  when the menu is not open. (#3030)
 - InputText: Fixed password fields displaying ASCII spaces as blanks instead of using the '*'
   glyph. (#2149, #515)
 - Font: Fixed non-ASCII space occasionally creating unnecessary empty polygons.
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index ef15476..681745b 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -6345,6 +6345,10 @@
             flags |= ImGuiWindowFlags_ChildWindow;
         menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
     }
+    else
+    {
+        g.NextWindowData.ClearFlags(); // We behave like Begin() and need to consume those values
+    }
 
     return menu_is_open;
 }