あなた自身のウェブページを作成しているなら、jquery/javascriptを少し書いて修正します。これは私が私の上で使ったことです。
欠点は、ページ上のデフォルトのタブキーの動作を妨げることです。これは、状況によってはアクセシビリティ上の大きな問題となる可能性があります。しかし、私はそれを疑う。
var Tab = {};
Tab.i = 1,
Tab.items = 0;
function fixTabulation() {
/* This can be used to auto-assign tab-indexes, or
# commented out if it manual tab-indexes have
# already been assigned.
*/
$('input, select, textarea').each(function(){
$(this).attr('tabindex', Tab.i);
Tab.i++;
Tab.items++;
});
Tab.i = 0;
/* We need to listen for any forward or backward Tab
# key event tell the page where to focus next.
*/
$(document).on({
'keydown' : function(e) {
if (navigator.appVersion.match("Safari")) {
if (e.keyCode == 9 && !e.shiftKey) { //Tab key pressed
e.preventDefault();
Tab.i != Tab.items ? Tab.i++ : Tab.i = 1;
$('input[tabindex="' + Tab.i + '"], select[tabindex="' + Tab.i + '"], textarea[tabindex="' + Tab.i + '"]').not('input[type="hidden"]').focus();
}
if (e.shiftKey && e.keyCode == 9) { //Tab key pressed
e.preventDefault();
Tab.i != 1 ? Tab.i-- : Tab.i = Tab.items;
$('input[tabindex="' + Tab.i + '"], select[tabindex="' + Tab.i + '"], textarea[tabindex="' + Tab.i + '"]').not('input[type="hidden"]').focus();
}
}
}
});
/* We need to update Tab.i if someone clicks into
# a different part of the form. This allows us
# to keep tabbing from the newly clicked input
*/
$('input[tabindex], select[tabindex], textarea[tabindex]').not('input[type="hidden"]').focus(function(e) {
Tab.i = $(this).attr('tabindex');
console.log(Tab.i);
});
}
$(document).ready(function() {
fixTabulation();
});
これは完璧なソリューションではありませんが、それは笑、システム環境設定でのSafariの設定を変更行くためにすべてのユーザーを伝えるよりもかなり優れています。
をだ(そのソースの順序が1000、1002、1001)、Safariが続くんtabindexの順序?どのような理由でも、Safariはテキストエリア/テキスト入力の優先順位を高くします。 –
いいえ、それでも動作しません。 Safariでhrefのtabindexが無視されているようです。私はそれが動作するかどうかを確認するボタンで回避策を試しています。 – Dhana