diff --git a/apps/admin-ui/src/components/realm-selector/RealmSelector.tsx b/apps/admin-ui/src/components/realm-selector/RealmSelector.tsx index b4aad21f3c..10c0b4a9e6 100644 --- a/apps/admin-ui/src/components/realm-selector/RealmSelector.tsx +++ b/apps/admin-ui/src/components/realm-selector/RealmSelector.tsx @@ -163,13 +163,15 @@ export const RealmSelector = () => { toggle={ setOpen(!open)} + onToggle={() => { + if (realms.length === 0) refresh(); + setOpen(!open); + }} className="keycloak__realm_selector_dropdown__toggle" > {realm} } - onFocus={refresh} dropdownItems={[...dropdownItems, addRealmComponent]} /> )}