mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 22:07:48 +08:00
Fix jumpToTop and panel position behaviour
This commit is contained in:
parent
b8cf96438c
commit
9370c5e0e6
@ -75,7 +75,7 @@ namespace UnityExplorer.UI.Panels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSuggestions(List<Suggestion> suggestions, bool jumpToTop = false)
|
public void SetSuggestions(List<Suggestion> suggestions, bool jumpToTop = true)
|
||||||
{
|
{
|
||||||
Suggestions = suggestions;
|
Suggestions = suggestions;
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ namespace UnityExplorer.UI.Panels
|
|||||||
base.UIRoot.SetActive(true);
|
base.UIRoot.SetActive(true);
|
||||||
base.UIRoot.transform.SetAsLastSibling();
|
base.UIRoot.transform.SetAsLastSibling();
|
||||||
buttonListDataHandler.RefreshData();
|
buttonListDataHandler.RefreshData();
|
||||||
scrollPool.Refresh(true, false);
|
scrollPool.Refresh(true, jumpToTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,13 +238,18 @@ namespace UnityExplorer.UI.Panels
|
|||||||
|
|
||||||
InputFieldRef input = CurrentHandler.InputField;
|
InputFieldRef input = CurrentHandler.InputField;
|
||||||
|
|
||||||
if (!input.Component.isFocused || input.Component.caretPosition == lastCaretPosition && input.UIRoot.transform.position == lastInputPosition)
|
//if (!input.Component.isFocused
|
||||||
|
// || (input.Component.caretPosition == lastCaretPosition && input.UIRoot.transform.position == lastInputPosition))
|
||||||
|
// return;
|
||||||
|
|
||||||
|
if (input.Component.caretPosition == lastCaretPosition && input.UIRoot.transform.position == lastInputPosition)
|
||||||
return;
|
return;
|
||||||
lastInputPosition = input.UIRoot.transform.position;
|
|
||||||
lastCaretPosition = input.Component.caretPosition;
|
|
||||||
|
|
||||||
if (CurrentHandler.AnchorToCaretPosition)
|
if (CurrentHandler.AnchorToCaretPosition)
|
||||||
{
|
{
|
||||||
|
if (!input.Component.isFocused)
|
||||||
|
return;
|
||||||
|
|
||||||
TextGenerator textGen = input.Component.cachedInputTextGenerator;
|
TextGenerator textGen = input.Component.cachedInputTextGenerator;
|
||||||
int caretIdx = Math.Max(0, Math.Min(textGen.characterCount - 1, input.Component.caretPosition));
|
int caretIdx = Math.Max(0, Math.Min(textGen.characterCount - 1, input.Component.caretPosition));
|
||||||
|
|
||||||
@ -261,6 +266,9 @@ namespace UnityExplorer.UI.Panels
|
|||||||
uiRoot.transform.position = input.Transform.position + new Vector3(-(input.Transform.rect.width / 2) + 10, -20, 0);
|
uiRoot.transform.position = input.Transform.position + new Vector3(-(input.Transform.rect.width / 2) + 10, -20, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastInputPosition = input.UIRoot.transform.position;
|
||||||
|
lastCaretPosition = input.Component.caretPosition;
|
||||||
|
|
||||||
this.Dragger.OnEndResize();
|
this.Dragger.OnEndResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user