diff --git a/HellionChat/Ui/SettingsTabs/Chat.cs b/HellionChat/Ui/SettingsTabs/Chat.cs index 99ee8f9..be246b0 100644 --- a/HellionChat/Ui/SettingsTabs/Chat.cs +++ b/HellionChat/Ui/SettingsTabs/Chat.cs @@ -169,6 +169,13 @@ internal sealed class Chat : ISettingsTab using (Plugin.FontManager.FontAwesome.Push()) ImGui.Button(FontAwesomeIcon.Plus.ToIconString(), new Vector2(buttonWidth, 0)); + // Open the selector popup on left-click; SelectorPopup uses + // ImRaii.ContextPopupItem internally which only opens on right- + // click otherwise — without this OpenPopup the button looked + // active but the popup never appeared on a normal click. + if (ImGui.IsItemClicked()) + ImGui.OpenPopup("WordAddPopup"); + if (SearchSelector.SelectorPopup("WordAddPopup", out var newWord, WordPopupOptions)) { Mutable.BlockedEmotes.Add(newWord); diff --git a/HellionChat/Util/SearchSelector.cs b/HellionChat/Util/SearchSelector.cs index 3219467..7d19770 100644 --- a/HellionChat/Util/SearchSelector.cs +++ b/HellionChat/Util/SearchSelector.cs @@ -84,7 +84,11 @@ public static class SearchSelector foreach (var i in clipper.Rows) { var searched = FilteredSearchSheet[i]; - using var pushedId = ImRaii.PushId(id); + // Mix the row index into the ImGui ID so each Selectable in + // the loop has a distinct ID — using the same id for every + // row collapsed all rows to a single ID-stack entry and made + // selection ambiguous. + using var pushedId = ImRaii.PushId($"{id}##{i}"); if (!drawSelectable(searched, options.IsSelected(searched))) continue;