Select text on focus on Input Element - mobile

When a user inputs texts, clicks elsewhere.. and reclicks on the input, how does one select all prior text on the inut??
anything thats similiar to onfocus=this.select(), ??

Related

how to add react clickable button element as text input along with free text in draftjs?

im aiming for a rich text input text component that enable user to type free text but also can insert tag/button-like element to the text box whenever user select something from select dialog similar to multiple selection interaction. think textarea combined with this.
i have tried to create my own contenteditable element, but its painful, i got issues in selection/caret position etc. so im wondering is it possible to do this in draftjs?

Vaadin ComboBox: clear input text on click

I want a filterable combobox. When I click on the input text, the cursor appears so I can insert some characters into the text.
As typing into the input box is supposed to filter the items in the combobox, the previous text is no longer needed. I want either to:
clear the input text
select all the text (so when I start typing, the
text is cleared) - according to http://dev.vaadin.com/ticket/7116 this is not possible
I have test this on vaadin textfields, it should work for combos too.
You can clear the text on the input capturing the focus event, as in the comments, but instead of using null, use the empty string "", the change will not be seen until you call requestRepaint on the component.
input.addListener(new FieldEvents.FocusListener() {
#Override
public void focus(FocusEvent event) {
input.setValue("");
input.requestRepaint();
}
});
However for this to work you has to lose the focus and gain it again, playing with the valueChange event (override, etc) could be better.

In WPF how to determine how focus received

I have a text box on a form and want to perform different actions when it receives focus depending on how the focus was received.
If the user clicks on the text box I want the standard method where the cursor is placed at the end of the text string inside the box. If the user tabs to the text box I want all of the text contained within the text box to be selected.
Is there an elegant way to accomplish this?
I suppose one thing you could try would be to set some application-level (or parent-level) tunneling events so you can toggle a flag indicating it was mouse clicked or keyboard pressed (PreviewMouseDown and PreviewKeyDown). Depending on what was previously pressed by checking that flag, you could do the appropriate action when the text box gets focus.

cursor is locked in the <input> when browsing in Nokia E72

I developed a simple web app in the browser where there are 3 input boxes . The first input box has a ajax search suggestion box drop down when user starts keying in something. For example, the first input box is for user to key in username, when user key in "alan", a dropdown-like suggestion box will show below the input box to show top 5 usersname contain the word "alan", the list is query from a sql server. After user select one of the username from the list, the user name is displayed in the input box, this is working fine.
But the problem is that after user selected the username from the dropdown-like list of usernames, the cursor is locked in the first input box and not able to move out from this input box. I've tried to set the focus to 2nd inputbox by putting in document.getElementbyID("secondinputboxid").focus hope but it doesn't set the focus to the second input box, really need help here.
Thanks.

Re-open the DropDown of an AutoCompleteBox in Silverlight when a user presses Enter

If a user types a few characters into an AutoCompleteBox, the DropDown is displayed as expected.
If the user then clicks elsewhere on the page, this removes the focus from the AutoCompleteBox, and the DropDown disappears... also as expected.
However, if a user then returns focus to the AutoCompleteBox, and wants to redisplay the DropDown, filtering on the characters already there, the instinct seems to be to press the Enter key to re-filter/re-display the results. This, however, does not happen.
I've managed to capture the Enter key event (must use KeyUp instead of KeyDown), but I'm not sure how to make the DropDown re-appear at that point. Ideas?
Just assign true to the IsDropDownOpen property:-
myACB.IsDropDownOpen = true;

Resources