From 5a8164cb94bf33353790b27fe96f84287df739c4 Mon Sep 17 00:00:00 2001 From: Harrison Hough Date: Fri, 22 Dec 2023 08:39:11 +0200 Subject: [PATCH] [SDK-719] fix: reverted force focus (#191) - added an extra condition to the fix I made in this PR [SDK-704] feat: fix pasted text display issue #183 because it without it, the field becomes difficult to type in due to the constant refocusing --- Editor/UI/EditorWindows/Templates/SubdomainTemplate.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Editor/UI/EditorWindows/Templates/SubdomainTemplate.cs b/Editor/UI/EditorWindows/Templates/SubdomainTemplate.cs index f31135f2..2eea2251 100644 --- a/Editor/UI/EditorWindows/Templates/SubdomainTemplate.cs +++ b/Editor/UI/EditorWindows/Templates/SubdomainTemplate.cs @@ -68,7 +68,10 @@ private EventCallback> SubdomainChanged(VisualElement errorI errorIcon.visible = !IsValidSubdomain(); if (changeEvent.previousValue == partnerSubdomain) return; subdomainField.SetValueWithoutNotify(partnerSubdomain); - subdomainField.Focus(); // forces text to resize, making new subdomain value visible + if (changeEvent.newValue != partnerSubdomain) + { + subdomainField.Focus(); // forces text to resize, making new subdomain value visible + } OnSubdomainChanged?.Invoke(partnerSubdomain); }; }