From 29c818abc06ef36d4c7f74d6af12d392f263c72c Mon Sep 17 00:00:00 2001 From: saicharan-zemoso Date: Tue, 24 Sep 2024 15:45:09 +0530 Subject: [PATCH] fixed the app title dropdown and it closes on interaction with other components --- .../ApplicationDropdownClose_spec.ts | 20 +++++++++++++++++++ .../Editor/EditorName/NavigationMenu.tsx | 8 ++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApplicationDropdownClose_spec.ts diff --git a/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApplicationDropdownClose_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApplicationDropdownClose_spec.ts new file mode 100644 index 000000000000..966a553d063a --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/OtherUIFeatures/ApplicationDropdownClose_spec.ts @@ -0,0 +1,20 @@ +import homePage from "../../../../locators/HomePage"; +const omnibar = require("../../../../locators/Omnibar.json"); + +describe("application dropdown interaction test", () => { + it("application dropdown closes when interacting with omni bar using hotkeys", () => { + cy.get(homePage.applicationName).click(); + cy.get(homePage.applicationEditMenu).should("be.visible"); + cy.wait(1000); + cy.get("body").type("{ctrl}{k}"); + cy.get(omnibar.categoryTitle).should("be.visible"); + cy.get(homePage.applicationEditMenu).should("not.exist"); + cy.get("body").type("{esc}"); + cy.get(omnibar.categoryTitle).should("not.exist"); + cy.get(homePage.applicationName).click(); + cy.get(homePage.applicationEditMenu).should("be.visible"); + cy.wait(1000); + cy.get("body").type("{ctrl}{p}"); + cy.get(homePage.applicationEditMenu).should("not.exist"); + }); +}); diff --git a/app/client/src/pages/Editor/EditorName/NavigationMenu.tsx b/app/client/src/pages/Editor/EditorName/NavigationMenu.tsx index 8edf49d58baf..6418e7dcdad3 100644 --- a/app/client/src/pages/Editor/EditorName/NavigationMenu.tsx +++ b/app/client/src/pages/Editor/EditorName/NavigationMenu.tsx @@ -13,9 +13,13 @@ interface NavigationMenuProps { export function NavigationMenu(props: NavigationMenuProps) { const { menuItems, setIsPopoverOpen } = props; - return ( - + { + setIsPopoverOpen(false); + }} + > {menuItems?.map((item, idx) => { return (