focus

Edit Text in ListActivity ListView loses focus when keyboard comes up

假装没事ソ 提交于 2019-12-17 10:53:29
问题 I have searched and searched for an answer to this question and everything that looked like an answer has not worked so I guess I will just ask. I have a couple of EditText boxes added to a ListView that is the basis to a ListActivity . When I set the windowSoftInputMode to adjustPan and click in an EditText it works until you click on it again and then the keyboard covers it up. When I use adjustResize it works except when the keyboard comes up the EditText loses focus and I have to tap on

Using :focus to style outer div?

此生再无相见时 提交于 2019-12-17 10:36:08
问题 When I begin writing text in the textarea, I want the outer div, with a class box, to have it's border turned solid instead of dashed, but somehow the :focus doesn't apply in this case. If it works with :active, how come it doesn't work with :focus? Any ideas why? (Note. I want the DIV's border to turn solid, NOT the textareas) div.box { width: 300px; height: 300px; border: thin dashed black; } div.box:focus{ border: thin solid black; } <div class="box"> <textarea rows="10" cols="25"><

How to focus an input field on Android browser through javascript or jquery

亡梦爱人 提交于 2019-12-17 09:56:32
问题 I've tried $('#field').focus() , and any other method found on the internet. Nothing worked. I have a simple html that reproduces the problem. <!DOCTYPE html> <html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#field').focus(); }); </script> </head> <body> <input type="text" id="field" name="field"/> </body> </html> Please help! 回答1: Actually, the general

How Do I Give a Textbox Focus in Silverlight?

╄→尐↘猪︶ㄣ 提交于 2019-12-17 09:22:16
问题 In my Silverlight application, I can't seem to bring focus to a TextBox control. On the recommendation of various posts, I've set the IsTabStop property to True and I'm using TextBox.Focus(). Though the UserControl_Loaded event is firing, the TextBox control isn't getting focus. I've included my very simple code below. What am I missing? Thanks. Page.xaml <UserControl x:Class="TextboxFocusTest.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

How do you clear the focus in javascript?

会有一股神秘感。 提交于 2019-12-17 05:43:24
问题 I know this shouldn't be that hard, but I couldn't find the answer on Google. I want to execute a piece of javascript that will clear the focus from whatever element it is on without knowing ahead of time which element the focus is on. It has to work on firefox 2 as well as more modern browsers. Is there a good way to do this? 回答1: Answer: document.activeElement ---edit---- Technically: document.activeElement.blur() ----edit 2---- function onElementFocused(e) { if (e && e.target) document

Set Focus on EditText

丶灬走出姿态 提交于 2019-12-17 04:46:36
问题 I have an EditText-Field and set an OnFocusChangeListener for it. When it has lost focus, a method is called, which checks the value of the EditText with one in the database. If the return-value of the method is true, a toast is shown and the focus should get back on the EditText again. The focus should always get back on the EditText and the keyboard should show, until the return-value of the method is false. EDIT: I think, I haven't made my real problem perfectly clear yet: No other Item on

jquery Setting cursor position in contenteditable div

不羁岁月 提交于 2019-12-17 03:54:53
问题 The old version of the question is below, after researching more, I decided to rephrase the question. The problem as before is, I need to focus a contenteditable div without highlighting the text, doing straight up focus highlights the text in Chrome. I realize that people solved this problems in textareas by resetting the caret position in the textarea. How can I do that with a contenteditable element? All the plugins I've tried only works with textareas. Thanks. Old Phrasing of the question

Android: Force EditText to remove focus? [duplicate]

十年热恋 提交于 2019-12-17 02:37:47
问题 This question already has answers here : How to stop EditText from gaining focus at Activity startup in Android (52 answers) Closed 4 years ago . I would like to be able to remove the focus from the EditText. For example if the Keyboard appears, and the user hides it with the back button, I would like the focus and the cursor to disappear. How can it be done? 回答1: You can add this to onCreate and it will hide the keyboard everytime the activty starts. You could also programatically change the

what causes component requestFocus to fail sometimes?

北城余情 提交于 2019-12-14 04:18:33
问题 I have a jDialog which contains some fields that need to get focused. I am seeing some strange behaviour where sometimes the focusing fails, and if you hit the tab key you can see the focus change in the underlying parent window below, so clearly the focus did not get transferred. I read the interesting article (by camickr) on focusing: http://tips4java.wordpress.com/2010/03/14/dialog-focus/ but that did not solve the problem. Using that listener though, I was easily able to add debugging to

Flutter - Trouble preserving focus between routes

孤街醉人 提交于 2019-12-14 04:08:02
问题 I have a form that uses FocusNode s to visually indicate which part of the form is active. One field extends a PopupRoute as a kind of pop up 'keyboard'. My problem is, when I press that field, the keyboard pops up but the visual effect of the focus doesn't occur. Some debugging from the FocusNode 's listeners shows it gets focus but immediately loses it. I think it is because the new PopupRoute has a new FocusScopeNode , so my FocusNode doesn't have focus any more. How can I keep the field