var txtf = new TextField() { value = "Hello World!" };
txtf.selectAllOnFocus = txtf.selectAllOnMouseUp = false;
txtf.RegisterCallback<MouseDownEvent>(UpdateMenu);
void UpdateMenu(EventBase evt)
{
if (evt.target is not TextField txtf) return;
Debug.Log($"MouseDown on TextField: {txtf.cursorIndex}, {txtf.selectIndex}");
}