Side navigation
#8678 closed bug (worksforme)
Opened March 28, 2011 02:10PM UTC
Closed March 28, 2011 07:08PM UTC
Last modified November 02, 2012 04:47PM UTC
.focus not working in Firefox 4
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$('#textbox').focus(); does not seem to work in Firefox 4. I have tested a script with this in Chrome, and it works OK. This is probably a Firefox 4 issue, not necessarily a jQuery one?
Attachments (0)
Change History (7)
Changed March 28, 2011 07:08PM UTC by comment:1
_comment0: | .focus() is working fine for me in FF4 without any issues. Depending on what you are trying to achieve, see here for a live example where clicking on a link set to focus the input textbox is working fine. http://jsfiddle.net/addyosmani/NmZ6z/. You'll notice that the focus handler is called with a message being appended to the document body, confirming that everything is working as expected. → 1301339375028219 |
---|---|
priority: | undecided → low |
resolution: | → worksforme |
status: | new → closed |
Changed April 13, 2011 02:26PM UTC by comment:2
My problem is that I have a textbox intended to hold numeric characters, if the user types a non-numeric character I will alert and focus back on the field. I'm using the jquery blur() event to put focus back on the field and it doesn't work.
Changed April 13, 2011 02:42PM UTC by comment:3
blur removes focus. See http://api.jquery.com/blur and http://api.jquery.com/focus
Changed April 13, 2011 02:42PM UTC by comment:4
component: | unfiled → event |
---|
Changed November 02, 2012 01:29PM UTC by comment:5
This bugs announced "working for me" is based on invalid usage. In focus() does not work if the controlling function is blur. In the following code the focus in not set to the originating text box if another text box is clicked on to trigger the blur()
$("#textbox").blur(function () {
$('body').append('focused on textbox');
if($("#textbox").val() > 24 )
{
alert('stop');
$("#textbox").focus();
return false;
}
});
Changed November 02, 2012 02:58PM UTC by comment:6
Here's a jsfiddle of the problem
Changed November 02, 2012 04:47PM UTC by comment:7
Sorry about that. The url pasted was not correct
Thanks for submitting a ticket to the jQuery Bug Tracker .focus() is working fine for me in FF4 without any issues. Depending on what you are trying to achieve, see here for a live example where clicking on a link set to focus the input textbox is working fine. http://jsfiddle.net/addyosmani/NmZ6z/. You'll notice that the focus handler is called with a message being appended to the document body, confirming that everything is working as expected.