Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!(FilledTag): 閉じるボタンはrole="button"でマークアップする #423

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

knokmki612
Copy link
Member

#37 での議論を反映します

@knokmki612 knokmki612 added the breaking-change This change doesn't have backward compatibility label Jun 28, 2023
@knokmki612 knokmki612 requested a review from Hidetaro7 June 28, 2023 04:10
@knokmki612 knokmki612 self-assigned this Jun 28, 2023
Hidetaro7
Hidetaro7 previously approved these changes Jul 5, 2023
Copy link
Contributor

@Hidetaro7 Hidetaro7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role属性で判定するで良いと思います

@knokmki612

This comment was marked as resolved.

@knokmki612 knokmki612 changed the base branch from main to test July 5, 2023 05:50
@knokmki612 knokmki612 changed the base branch from test to main July 5, 2023 05:50
@knokmki612 knokmki612 dismissed Hidetaro7’s stale review July 5, 2023 05:50

The base branch was changed.

@knokmki612 knokmki612 requested a review from Hidetaro7 July 5, 2023 05:51
@knokmki612
Copy link
Member Author

knokmki612 commented Jul 5, 2023

コンフリクトを解決しました。お手数をおかけしますが改めてレビューをお願いします。

@@ -61,7 +61,7 @@ import html from "./html";
<Story name="Closable">
{html` <div class="jumpu-filled-tag">
デフォルト
<button />
<div role="button" aria-label="閉じる" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div要素の空要素はよしとするべきでしょうか?
仕様書には明確にだめとは書いてないように思えますが、あまり見なかったので気になって確認したいところです。
明確な理由があればよいです。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://validator.w3.org/nu/#textarea に以下を入力すると valid です。

<!DOCTYPE html>
<html lang="ja">
<head>
<title>test</title>
</head>
<div role="button" aria-label="閉じる"></div>
</html>

Copy link
Member Author

@knokmki612 knokmki612 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element のコンテントモデルをみればdiv要素になにが含められるかが分かりますが、フローコンテントが含められます。

そして空の要素というのは空のテキストノードともいえるはずなので、おそらくOKです。

ちなみにbr要素はコンテントモデルなし
https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element

ただしNothingコンテントモデルであることと終端タグが必要かどうかとは必ずしも一致しないようです
https://html.spec.whatwg.org/multipage/dom.html#the-nothing-content-model

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

まあ、空要素といっても終了タグ(終端?)が省略されているケースが気になっただけで、
よく考えたら空要素のまま運用するわけだから、問題なかったですよね。
お騒がせしました。

Copy link
Member Author

@knokmki612 knokmki612 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

終了タグ(終端?)が省略されているケースが気になっただけ

それはHTML仕様違反だと思います
以下のTag omission in text/html にあるとおりです
https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element

JSXならそれはよしなにしてくれるはずですが、この箇所がどういう取り扱いだったかすこし定かでないです。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://tuqulore.github.io/jumpu-ui/?path=/docs/status-filledtag--docs#closable などをみると、ドキュメントにはそのまま閉じタグが省略されているので、これは修正したほうがよさそうです

image

@knokmki612 knokmki612 merged commit 6c80e1a into main Jul 5, 2023
@knokmki612 knokmki612 deleted the filled-tag-close-button branch July 5, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This change doesn't have backward compatibility
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants