473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

focus listener on non-form elements in Safari/Chrome

Setting the tabIndex property an element makes it focusable and attached
key listeners respond. Or so it seems...

This procedure works in - from what I've tested - IE6+, FF, Opera.
However, Safari and Chrome (and perhaps others) fail to respond,
obviously myElement.focus() can be called, but shows no further effect.

One possibility might be a listener attached to the document, which then
redirects the event to the "focused" element - not really elegant.

Did I overlook something, or does the tabIndex/focus trick simply not
work in Safari/Chrome?

Gregor
Nov 6 '08 #1
1 2889
Gregor Kofler wrote:
Setting the tabIndex property an element makes it focusable and attached
key listeners respond. Or so it seems...

This procedure works in - from what I've tested - IE6+, FF, Opera.
However, Safari and Chrome (and perhaps others) fail to respond,
obviously myElement.focus() can be called, but shows no further effect.
What is `myElement'? Not every element object has a focus() method to begin
with.
One possibility might be a listener attached to the document, which then
redirects the event to the "focused" element - not really elegant.
ACK.
Did I overlook something, or does the tabIndex/focus trick simply not
work in Safari/Chrome?
Dunno. Post your test case. (I guess you saw that coming ;-))
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Nov 6 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cherrish Vaidiyan | last post by:
sir, I have a small error in Listener configuration.I have two system with a database in each. I am using Red Hat 9 and Oracle 9i. so i shall anme the database and system. system 1 - node2 ...
5
by: Axel Dachtler | last post by:
Hi, I have a listener problem. The listener cannot read SERVICE_NAME in TNS-Descriptor. The service-name I specified in Oracle Net Manager for this database is testdb as well. ...
6
by: joe | last post by:
Hi Everyone, could anyone comment on the following problem: I have a textbox being appended to a cell in a table, and am trying to call focus() on like this: <snip> c01.removeChild(answerbox);...
8
by: Terry Olsen | last post by:
I've tried the following code straight out of MSDN. But my app still blocks while listening. Isn't this code supposed to keep the UI responsive while listening? Or maybe I'm not doing it...
1
by: Alex Calder | last post by:
How's that for a subject line? :) OK, here's the deal. I have a web page that features a Flash movie about halfway down the page, and inside that Flash movie is content that typically...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
5
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually...
1
by: abolduc | last post by:
I have had an underwhelming amount of success hunting down the source of this error and am hoping that someone here may have some insight. Error logged in the event log: Source: MSSQLSERVER...
1
by: michael ngong | last post by:
michael.john@gmx.at (Michael John) wrote in message news:<90cc4edd.0306230900.28075193@posting.google.com>... MIchael I you stated the OS and platform that could make it easier to address your...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.