This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(list): added #adapter.listItemAtIndexHasClass to prevent user state change to disabled items #4922
Merged
Merged
fix(list): added #adapter.listItemAtIndexHasClass to prevent user state change to disabled items #4922
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fb480ef
fix(list): added #adapter.isListItemDisabled to prevent user interact…
cd8cf01
fix: pr changes
0d6bb26
lint
6064a98
Merge remote-tracking branch 'origin/develop' into fix/list-checkbox-…
allan-chen 4145c88
renaming + bugfixes
allan-chen 5c04ea3
tie up renaming loose ends
allan-chen f059f8d
update goldens
allan-chen bd13af1
remove unused constants
allan-chen fd9a861
Merge branch 'develop' into fix/list-checkbox-disabled
allan-chen 7270720
generalize adapter method to check for any class
allan-chen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
test/screenshot/spec/mdc-list/classes/disabled-checkbox.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Copyright 2018 Google Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
--> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Disabled Checkbox List - MDC Web Screenshot Test</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="../../../out/mdc.list.css"> | ||
<link rel="stylesheet" href="../../../out/mdc.checkbox.css"> | ||
<link rel="stylesheet" href="../../../out/spec/fixture.css"> | ||
<link rel="stylesheet" href="../../../out/spec/mdc-list/fixture.css"> | ||
|
||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-118996389-2"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-118996389-2'); | ||
</script> | ||
</head> | ||
|
||
<body class="test-container"> | ||
<main class="test-viewport test-viewport--mobile"> | ||
<div class="test-layout"> | ||
<div class="test-cell test-cell--list"> | ||
<ul class="mdc-list test-checkbox-list" style="list-style-type: none;" role="group" aria-label="Checkbox options"> | ||
<li class="mdc-list-item" role="checkbox" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-checkbox"> | ||
<input type="checkbox" | ||
class="mdc-checkbox__native-control" | ||
id="test-list-checkbox-item-1" /> | ||
<div class="mdc-checkbox__background"> | ||
<svg class="mdc-checkbox__checkmark" | ||
viewBox="0 0 24 24"> | ||
<path class="mdc-checkbox__checkmark-path" | ||
fill="none" | ||
d="M1.73,12.91 8.1,19.28 22.79,4.59"/> | ||
</svg> | ||
<div class="mdc-checkbox__mixedmark"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-checkbox-item-1">Option 1</label> | ||
</li> | ||
<li class="mdc-list-item mdc-list-item--disabled" role="checkbox" aria-checked="true" tabindex="0"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-checkbox mdc-checkbox--disabled"> | ||
<input type="checkbox" | ||
class="mdc-checkbox__native-control" | ||
id="test-list-checkbox-item-2" | ||
checked | ||
disabled /> | ||
<div class="mdc-checkbox__background"> | ||
<svg class="mdc-checkbox__checkmark" | ||
viewBox="0 0 24 24"> | ||
<path class="mdc-checkbox__checkmark-path" | ||
fill="none" | ||
d="M1.73,12.91 8.1,19.28 22.79,4.59"/> | ||
</svg> | ||
<div class="mdc-checkbox__mixedmark"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-checkbox-item-2">Option 2</label> | ||
</li> | ||
<li class="mdc-list-item" role="checkbox" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-checkbox"> | ||
<input type="checkbox" | ||
class="mdc-checkbox__native-control" | ||
id="test-list-checkbox-item-3" /> | ||
<div class="mdc-checkbox__background"> | ||
<svg class="mdc-checkbox__checkmark" | ||
viewBox="0 0 24 24"> | ||
<path class="mdc-checkbox__checkmark-path" | ||
fill="none" | ||
d="M1.73,12.91 8.1,19.28 22.79,4.59"/> | ||
</svg> | ||
<div class="mdc-checkbox__mixedmark"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-checkbox-item-3">Option 3</label> | ||
</li> | ||
<li class="mdc-list-item" role="checkbox" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-checkbox"> | ||
<input type="checkbox" | ||
class="mdc-checkbox__native-control" | ||
id="test-list-checkbox-item-4" /> | ||
<div class="mdc-checkbox__background"> | ||
<svg class="mdc-checkbox__checkmark" | ||
viewBox="0 0 24 24"> | ||
<path class="mdc-checkbox__checkmark-path" | ||
fill="none" | ||
d="M1.73,12.91 8.1,19.28 22.79,4.59"/> | ||
</svg> | ||
<div class="mdc-checkbox__mixedmark"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-checkbox-item-4">Option 4</label> | ||
</li> | ||
<li class="mdc-list-item" role="checkbox" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-checkbox"> | ||
<input type="checkbox" | ||
class="mdc-checkbox__native-control" | ||
id="test-list-checkbox-item-5" /> | ||
<div class="mdc-checkbox__background"> | ||
<svg class="mdc-checkbox__checkmark" | ||
viewBox="0 0 24 24"> | ||
<path class="mdc-checkbox__checkmark-path" | ||
fill="none" | ||
d="M1.73,12.91 8.1,19.28 22.79,4.59"/> | ||
</svg> | ||
<div class="mdc-checkbox__mixedmark"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-checkbox-item-5">Option 5</label> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</main> | ||
|
||
<!-- Automatically provides/replaces `Promise` if missing or broken --> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.0.13/fontfaceobserver.standalone.js"></script> | ||
<script src="../../../out/material-components-web.js"></script> | ||
<script src="../../../out/spec/fixture.js"></script> | ||
<script src="../../../out/spec/mdc-list/fixture.js"></script> | ||
</body> | ||
</html> |
143 changes: 143 additions & 0 deletions
143
test/screenshot/spec/mdc-list/classes/disabled-radio.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Copyright 2018 Google Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
--> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Disabled Radio List - MDC Web Screenshot Test</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="../../../out/mdc.list.css"> | ||
<link rel="stylesheet" href="../../../out/mdc.radio.css"> | ||
<link rel="stylesheet" href="../../../out/spec/fixture.css"> | ||
<link rel="stylesheet" href="../../../out/spec/mdc-list/fixture.css"> | ||
|
||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-118996389-2"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-118996389-2'); | ||
</script> | ||
</head> | ||
|
||
<body class="test-container"> | ||
<main class="test-viewport test-viewport--mobile"> | ||
<div class="test-layout"> | ||
<div class="test-cell test-cell--list"> | ||
<ul class="mdc-list test-radio-list" role="radiogroup" style="list-style-type: none;"> | ||
<li class="mdc-list-item" role="radio" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-radio"> | ||
<input class="mdc-radio__native-control" | ||
type="radio" | ||
id="test-list-radio-item-1" | ||
name="test-list-radio-item-group" | ||
value="1"> | ||
<div class="mdc-radio__background"> | ||
<div class="mdc-radio__outer-circle"></div> | ||
<div class="mdc-radio__inner-circle"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-radio-item-1">Option 1</label> | ||
</li> | ||
<li class="mdc-list-item mdc-list-item--disabled" role="radio" aria-checked="true" tabindex="0"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-radio mdc-radio--disabled"> | ||
<input class="mdc-radio__native-control" | ||
type="radio" | ||
id="test-list-radio-item-2" | ||
name="test-list-radio-item-group" | ||
value="2" | ||
checked | ||
disabled > | ||
<div class="mdc-radio__background"> | ||
<div class="mdc-radio__outer-circle"></div> | ||
<div class="mdc-radio__inner-circle"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-radio-item-2">Option 2</label> | ||
</li> | ||
<li class="mdc-list-item" role="radio" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-radio"> | ||
<input class="mdc-radio__native-control" | ||
type="radio" | ||
id="test-list-radio-item-3" | ||
name="test-list-radio-item-group" | ||
value="3"> | ||
<div class="mdc-radio__background"> | ||
<div class="mdc-radio__outer-circle"></div> | ||
<div class="mdc-radio__inner-circle"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-radio-item-3">Option 3</label> | ||
</li> | ||
<li class="mdc-list-item" role="radio" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-radio"> | ||
<input class="mdc-radio__native-control" | ||
type="radio" | ||
id="test-list-radio-item-4" | ||
name="test-list-radio-item-group" | ||
value="4"> | ||
<div class="mdc-radio__background"> | ||
<div class="mdc-radio__outer-circle"></div> | ||
<div class="mdc-radio__inner-circle"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-radio-item-4">Option 4</label> | ||
</li> | ||
<li class="mdc-list-item" role="radio" aria-checked="false"> | ||
<span class="mdc-list-item__graphic"> | ||
<div class="mdc-radio"> | ||
<input class="mdc-radio__native-control" | ||
type="radio" | ||
id="test-list-radio-item-5" | ||
name="test-list-radio-item-group" | ||
value="5"> | ||
<div class="mdc-radio__background"> | ||
<div class="mdc-radio__outer-circle"></div> | ||
<div class="mdc-radio__inner-circle"></div> | ||
</div> | ||
</div> | ||
</span> | ||
<label class="mdc-list-item__text test-list-item__label" for="test-list-radio-item-5">Option 5</label> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</main> | ||
|
||
<!-- Automatically provides/replaces `Promise` if missing or broken. --> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.0.13/fontfaceobserver.standalone.js"></script> | ||
<script src="../../../out/material-components-web.js"></script> | ||
<script src="../../../out/spec/fixture.js"></script> | ||
<script src="../../../out/spec/mdc-list/fixture.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to sync this to internal and implement this adapter before merging it.