Silfverstrom
Silfverstrom

Reputation: 29330

GWT: Problems using TextBox.selectAll() on "onFocus event" in Chrome

In GWT, I'm using TextBox.selectAll() in a TextBox widget - which is triggered from a OnFocus event.

This works fine in FireFox, but in chrome it quickly selects the text and then deselects it again. I'm guessing that another event is being triggered, forcing the textbox to deselect the text.

Has anyone encountered such a problem?

Upvotes: 2

Views: 1456

Answers (1)

BobV
BobV

Reputation: 4173

Try calling selectAll() from a Scheduler.get().scheduleDeferred(). It's possible that the focus event is being received before the normal caret-position update is handled by the UI.

Upvotes: 8

Related Questions