Mac Safari 15似乎没有显示默认的焦点状态。

huangapple go评论72阅读模式
英文:

Mac Safari 15 doesn't seem to show a default focus state

问题

以下是要翻译的内容:

"Does anyone know of existing focus state issues or tab index issues, relating to Mac Safari?

Go to: https://codepen.io/Richard-Stelmach/pen/abRMpyj

Try tabbing through the content in Mac Safari, 15.

No focus state is shown.

If you try the same in Chrome, a focus state is shown, and you can tab through the relevant elements on the page.

No focus state has been set in the html, css, as want to use the browser default focus state.

DEMO:"

英文:

Does anyone know of existing focus state issues or tab index issues, relating to Mac Safari?

Go to: https://codepen.io/Richard-Stelmach/pen/abRMpyj

Try tabbing through the content in Mac safari, 15.

No focus state is shown.

If you try the same in Chrome, a focus state is shown, and you can tab through the relevant elements on the page.

No focus state has been set in the html, css, as want to use the browser default focus state.

DEMO:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

@import url(&#39;https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&amp;display=swap&#39;);

*{
  line-height: calc(1ex / 0.32);
  font-family: &#39;Atkinson Hyperlegible&#39;, sans-serif;
}
@supports (font-size-adjust: 1;) {
    body {
        font-size-adjust: 0.5;
    }
}

.container{
  padding:24px;
}
.dark{
  background:#203240;
  color:white;
}
.dark a{
  color:white;
}
.light{
  background:white;
  color:#203240;
}

fieldset{
  margin-bottom:24px;
}

h1 {
    font-size: 2.5em;
    line-height: calc(1ex / 0.42);
    margin: calc(1ex / 0.42) 0;
}

h2 {
    font-size: 2em;
    line-height: calc(1ex / 0.42);
    margin: calc(1ex / 0.42) 0;
}

h3 {
    font-size: 1.75em;
    line-height: calc(1ex / 0.38);
    margin: calc(1ex / 0.38) 0;
}

h4 {
    font-size: 1.5em;
    line-height: calc(1ex / 0.37);
    margin: calc(1ex / 0.37) 0;
}

p {
    font-size: 1em;
    line-height: calc(1ex / 0.32);
    margin: calc(1ex / 0.32) 0;
}

input{
  font-size:1em;
}

<!-- language: lang-html -->

&lt;div class=&#39;light container&#39;&gt;
  &lt;h1&gt;Focus states&lt;/h1&gt;
  &lt;h2&gt;Default focus states&lt;/h2&gt;
  &lt;p&gt;To help determine how browsers treat the &lt;a href=&#39;https://css-tricks.com/copy-the-browsers-native-focus-styles/&#39;&gt;focus states&lt;/a&gt; of elements, by default&lt;/p&gt;

  &lt;form action=&quot;http://www.example.com/cgi/subscribe/&quot; method=&quot;post&quot;&gt;
    &lt;fieldset&gt;
    &lt;legend&gt;Example radio buttons&lt;/legend&gt;
      &lt;div&gt;
        &lt;input type=&quot;radio&quot; name=&quot;format&quot; id=&quot;someRadio&quot; value=&quot;Some radio&quot; checked&gt;
        &lt;label for=&quot;someRadio&quot;&gt;Some radio&lt;/label&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;input type=&quot;radio&quot; name=&quot;format&quot; id=&quot;anotherRadio&quot; value=&quot;Another radio&quot;&gt;
        &lt;label for=&quot;anotherRadio&quot;&gt;Another radio&lt;/label&gt;
      &lt;/div&gt;
    &lt;/fieldset&gt;
    &lt;fieldset&gt;
    &lt;legend&gt;Example checkbox&lt;/legend&gt;
      &lt;div&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;example checkbox&quot; id=&quot;check_1&quot;&gt;
        &lt;label for=&quot;check_1&quot;&gt;Example checkbox&lt;/label&gt;
      &lt;/div&gt;
    &lt;/fieldset&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;
  &lt;/form&gt;
&lt;/div&gt;

<!-- end snippet -->

答案1

得分: 0

请尝试进入Safari / 设置 / 高级,并检查是否选中了“按Tab键突出显示每个项目”(或未选中)。如果没有选中,请选中它然后重新测试。

英文:

Try going to Safari / Settings / Advanced and check to see if "Press tab to highlight each item" is checked (or not). If it's not checked, then check that and retest.

huangapple
  • 本文由 发表于 2023年5月26日 16:01:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76338811.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定