mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
ToggleButton: Use label so users can click text (#13876)
This commit is contained in:
parent
e3ea4f2cd0
commit
b5088f65a9
@ -190,7 +190,7 @@ describe('Send ETH from dapp using advanced gas controls', function () {
|
||||
await driver.clickElement({ text: 'Settings', tag: 'div' });
|
||||
await driver.clickElement({ text: 'Advanced', tag: 'div' });
|
||||
await driver.clickElement(
|
||||
'[data-testid="advanced-setting-show-testnet-conversion"] .settings-page__content-item-col > div > div',
|
||||
'[data-testid="advanced-setting-show-testnet-conversion"] .settings-page__content-item-col > label > div',
|
||||
);
|
||||
const advancedGasTitle = await driver.findElement({
|
||||
text: 'Advanced gas controls',
|
||||
@ -198,7 +198,7 @@ describe('Send ETH from dapp using advanced gas controls', function () {
|
||||
});
|
||||
await driver.scrollToElement(advancedGasTitle);
|
||||
await driver.clickElement(
|
||||
'[data-testid="advanced-setting-advanced-gas-inline"] .settings-page__content-item-col > div > div',
|
||||
'[data-testid="advanced-setting-advanced-gas-inline"] .settings-page__content-item-col > label > div',
|
||||
);
|
||||
windowHandles = await driver.getAllWindowHandles();
|
||||
extension = windowHandles[0];
|
||||
|
@ -1,5 +1,7 @@
|
||||
.toggle-button {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
|
||||
$self: &;
|
||||
|
||||
&__status {
|
||||
|
@ -52,7 +52,7 @@ const ToggleButton = (props) => {
|
||||
const modifier = value ? 'on' : 'off';
|
||||
|
||||
return (
|
||||
<div
|
||||
<label
|
||||
tabIndex="0"
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
@ -82,7 +82,7 @@ const ToggleButton = (props) => {
|
||||
<span className="toggle-button__label-off">{offLabel}</span>
|
||||
<span className="toggle-button__label-on">{onLabel}</span>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user