TabItem requires two clicks to select #6318

Closed
opened 2023-04-11 01:26:37 +00:00 by ZhouMin216 · 3 comments
ZhouMin216 commented 2023-04-11 01:26:37 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version: 1.89.3 WIP
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_android.h imgui_impl_opengl3.h
Operating System: Android

My Issue/Question:

Hi all,
When I use BeginTabItem on the Windows system, it is selected by clicking once. When using it on the Android system, I must click twice, or first click on another location, and then click TabItem to be selected. It seems that there are no different behaviors set for different systems in the source code. What do I need to do to select TabItem with just one click on the Android platform?
Thanks for any help.

Video:
https://user-images.githubusercontent.com/47287700/231030790-1a42001f-ef08-4f2c-9f69-2d92f749844e.mp4

          if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags))
          {
              for (int n = 0; n < IM_ARRAYSIZE(opened); n++)
                  if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n], ImGuiTabItemFlags_None))
                  {
                      ImGui::Text("This is the %s tab!", names[n]);
                      if (n & 1)
                          ImGui::Text("I am an odd tab.");
                      ImGui::EndTabItem();
                  }
              ImGui::EndTabBar();
          }
**Version/Branch of Dear ImGui:** Version: 1.89.3 WIP Branch: master **Back-end/Renderer/Compiler/OS** Back-ends: imgui_impl_android.h imgui_impl_opengl3.h Operating System: Android **My Issue/Question:** Hi all, When I use BeginTabItem on the Windows system, it is selected by clicking once. When using it on the Android system, I must click twice, or first click on another location, and then click TabItem to be selected. It seems that there are no different behaviors set for different systems in the source code. What do I need to do to select TabItem with just one click on the Android platform? Thanks for any help. **Video:** https://user-images.githubusercontent.com/47287700/231030790-1a42001f-ef08-4f2c-9f69-2d92f749844e.mp4 ``` if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) { for (int n = 0; n < IM_ARRAYSIZE(opened); n++) if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n], ImGuiTabItemFlags_None)) { ImGui::Text("This is the %s tab!", names[n]); if (n & 1) ImGui::Text("I am an odd tab."); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ```
ocornut commented 2023-04-11 08:04:05 +00:00 (Migrated from github.com)

Hello,
Coincidentally, even thought this has been a problem with touch device for years this was JUST fixed with c9fe7ebc + for Android db4c4e33. If you update to latest master it should work.

Hello, Coincidentally, even thought this has been a problem with touch device for years this was JUST fixed with c9fe7ebc + for Android db4c4e33. If you update to latest master it should work.
ZhouMin216 commented 2023-04-11 08:27:03 +00:00 (Migrated from github.com)

Hello, Coincidentally, even thought this has been a problem with touch device for years this was JUST fixed with c9fe7eb + for Android db4c4e3. If you update to latest master it should work.
Thank you for your reply! I'll give it a try

> Hello, Coincidentally, even thought this has been a problem with touch device for years this was JUST fixed with [c9fe7eb](https://github.com/ocornut/imgui/commit/c9fe7ebc7bd1badfaee7d901cbddc11f43030a32) + for Android [db4c4e3](https://github.com/ocornut/imgui/commit/db4c4e3321ec28ea78a016fd06c84d76a3aaf820). If you update to latest master it should work. Thank you for your reply! I'll give it a try
ZhouMin216 commented 2023-04-11 08:40:13 +00:00 (Migrated from github.com)

@ocornut I have updated to the latest master and this issue has been well resolved. Thank you very much.

@ocornut I have updated to the latest master and this issue has been well resolved. Thank you very much.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#6318
No description provided.