focus

CSS Input field text color of inputted text

[亡魂溺海] 提交于 2019-12-17 23:26:11
问题 I have an input field, and the color of the text in it is black. (I'm using jquery.placeholder) Let's say the text in there is "E-Mail" When you click on this field, the black placeholding text dissapears (thanks to jquery.placeholder). Any text inputted into this field, I want it to turn red, and when you deselect this field, I want it to stay red. At the moment, the text saying "E-Mail" is black, and anything I type into is red, which is great, but as soon as i deselect, it goes back to

Why isn't this textarea focusing with .focus()?

假如想象 提交于 2019-12-17 22:38:33
问题 I have this code to focus a textarea when the user clicks on the "Reply" button: $('#reply_msg').live('mousedown', function() { $(this).hide(); $('#reply_holder').show(); $('#reply_message').focus(); }); It shows the reply form, but the textarea won't focus. I'm adding the textarea via AJAX which is why I am using .live() . The box that I add shows (I even add #reply_msg via AJAX and stuff happens when I mouse down on it) but it won't focus on the textarea. Edit My HTML looks like: <div id=

WPF Reset Focus on Button Click

江枫思渺然 提交于 2019-12-17 22:37:58
问题 I have a TextBox and a ToolBar with a Button . If I'm typing in the TextBox and I click the Button I want the TextBox to lose Focus so the binding gets updated. I don't want to add a UpdateSourceTrigger=PropertyChanged to my TextBox . But instead when I click on the Button I reset Focus to the main window so what ever I'm on loses Focus and updates the bindings. I've tried adding a OnClick to the button with the following, but it doesn't seem to work: private void Button_Click(object sender,

Show window in Qt without stealing focus

£可爱£侵袭症+ 提交于 2019-12-17 22:18:08
问题 I'm using the Qt library to show a slideshow on the second monitor when the user isn't using the second monitor. An example is the user playing a game in the first monitor and showing the slideshow in the second monitor. The problem is that when I open a new window in Qt, it automatically steals the focus from the previous application. Is there any way to prevent this from happening? 回答1: It took me a while to find it but I found it: setAttribute(Qt::WA_ShowWithoutActivating); This forces the

jquery focus on load

烂漫一生 提交于 2019-12-17 20:58:36
问题 How to set the focus on a html element ? I use document.getElementById('ID_HTML_wanted').focus(); but my html element "ID_HTML_wanted" as not the focus. I user jquery api .focus 回答1: Try to wrap your code to this code so it executes AFTER DOM is ready $(function(){ //your code }); so it will become $(function(){ document.getElementById('ID_HTML_wanted').focus(); }); However, your element't don't have .focus() method, if you want to REALLY use jQuery's one, use $(function(){ $("#ID_HTML_wanted

C# Stop Button From Gaining Focus on Click

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 20:16:00
问题 I have several buttons that when clicked I don't want them to get focus nor do I want the space bar to 'press' them again. I want the same functionality as the buttons in windows calculator. Googled and searched stack everything seems to be about forms eg. Make a form not focusable in C# I know I'm supposed to rewrite WndProc but not exactly sure how to proceed as to what messages I should catch/ignore etc. As far as I got: protected override void WndProc(ref Message m) { base.WndProc(ref m);

IPhone iOS 4.3 camera focus square - removeable programmatically?

蓝咒 提交于 2019-12-17 19:54:37
问题 Since my friend updated his iPhone iOS to 4.3 there's a small square which appears every time he takes a picture with the camera. We're developing an app that uses the camera and would like to remove this annoying square. I didn't find anything about it in Apple's UIImagePickerController documentation. The square didn't exist in former iOS versions. 回答1: You may want to try to lock the focus to disable auto-focus. Here is a sample code: NSArray *devices = [AVCaptureDevice devices]; NSError

Keep text selection when focus changes

时光毁灭记忆、已成空白 提交于 2019-12-17 19:52:37
问题 I have a normal textbox, and a lightbox with a text input. I want to keep the user's selection in the textbox, even when the user focuses on the lightbox's text input. Select text in normal textbox Toggle lightbox Focus on lightbox input At step 3., the user's text selection is discarded. How can this be prevented? See Google docs link insertion lightbox for example. Thanks :) Update Ok, so Google docs uses an iframe for the blank page section, which is how they are handling the multiple

RecyclerView focus scrolling

偶尔善良 提交于 2019-12-17 19:24:59
问题 I have a RecyclerView with usually two columns and up to eight. We use a lot of D-PAD navigation. We have a problem when scrolling, the focused item will jump from left to right. See photos: I noticed that if the items that are coming up next are cached, there is no focus problem when scrolling. Another problem I have is my focus item can appear below my sticky header. This is not desired. So I feel like if I made it so when scrolling it would have a sort of "threshold". This way when the

EditText inside ListView will not stay focused [duplicate]

江枫思渺然 提交于 2019-12-17 18:46:37
问题 This question already has answers here : Focusable EditText inside ListView (12 answers) Closed 6 years ago . I have an EditText inside each row of a ListView . For some reason, when I tap the EditText, it briefly gains focus but then immediately loses it. I have tried these things: listView.setItemsCanFocus(true); editText.setFocusable(true); While the EditText is (briefly) focused, the Enter key says Next and the auto-correct bar is present. When it loses focus, the soft keyboard stays up,