diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 405bbe37a98..d32d0bf8241 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -81,7 +81,13 @@ describe('Workspace', function() { ] cy.getContent().click() buttons.forEach(([button, tag]) => testButtonUnselected(button, tag)) - cy.getContent().type('Format me{selectall}') + // format is gone when text is gone + cy.getContent().type('Format me') + cy.getContent().find('s') + .should('not.exist') + cy.getContent() + .should('contain', 'Format me') + cy.getContent().type('{selectall}') buttons.forEach(([button, tag]) => testButton(button, tag, 'Format me')) }) @@ -303,13 +309,15 @@ const openSidebar = filename => { * @param {string} content Content expected in the element. */ function testButton(button, tag, content) { - cy.getMenuEntry(button).click() - cy.getMenuEntry(button).should('have.class', 'is-active') + cy.getMenuEntry(button) + .should('not.have.class', 'is-active') + .click() cy.getContent() .find(`${tag}`) .should('contain', content) - cy.getMenuEntry(button).click() - cy.getMenuEntry(button).should('not.have.class', 'is-active') + cy.getMenuEntry(button) + .should('have.class', 'is-active') + .click() } /** @@ -318,16 +326,11 @@ function testButton(button, tag, content) { * @param {string} tag Html tag expected to be toggled. */ function testButtonUnselected(button, tag) { - cy.getMenuEntry(button).click() - cy.getMenuEntry(button).should('have.class', 'is-active') - cy.getContent().type('Format me{selectall}') + cy.getMenuEntry(button) + .should('not.have.class', 'is-active') + .click() + cy.getContent().type('Format me') cy.getContent().find(`${tag}`) - .should('contain', 'Format me').type('{del}') - cy.getMenuEntry(button).click() - cy.getMenuEntry(button).should('have.class', 'is-active').click() - cy.getMenuEntry(button).should('not.have.class', 'is-active') - cy.getContent().type('Format me{selectall}') - cy.getMenuEntry(button).find(`${tag}`) - .should('not.exist') - cy.getContent().type('{del}') + .should('contain', 'Format me') + cy.getContent().type('{selectall}{del}') } diff --git a/src/components/Menu/ActionEntry.scss b/src/components/Menu/ActionEntry.scss index d85e0ce036a..ad5c2182a01 100644 --- a/src/components/Menu/ActionEntry.scss +++ b/src/components/Menu/ActionEntry.scss @@ -1,12 +1,3 @@ -%text__is-active-item-btn { - opacity: 1; - background-color: var(--color-primary-element-light); - border-radius: 50%; - .material-design-icon > svg { - fill: var(--color-primary-element); - } -} - .text-menubar, .v-popper__inner { button.entry-action__button { height: 44px; @@ -14,7 +5,6 @@ border: 0; // opacity: 0.5; position: relative; - color: var(--color-main-text); background-color: transparent; vertical-align: top; box-shadow: none; @@ -49,25 +39,15 @@ box-shadow: var(--color-primary-element); } - &.is-active { - @extend %text__is-active-item-btn; - } } - .entry-action.is-active:not(.entry-action-item) { - @extend %text__is-active-item-btn; - } - - .entry-action.entry-action-item { - &.is-active { - background-color: var(--color-primary-element-light); - border-radius: var(--border-radius-large); - } + .button-vue { + margin-right: 2px; } - .button-vue { - svg { - fill: var(--color-main-text); + @media only screen and (max-width: 767px) { + .button-vue { + margin-right: 0; } } diff --git a/src/components/Menu/ActionList.vue b/src/components/Menu/ActionList.vue index d566aa32c3d..b6bbcbab797 100644 --- a/src/components/Menu/ActionList.vue +++ b/src/components/Menu/ActionList.vue @@ -27,6 +27,8 @@ v-bind="state" :container="menuIDSelector" :aria-label="actionEntry.label" + :aria-pressed="state.active" + :type="state.active ? 'primary': 'tertiary'" :aria-activedescendant="currentChild ? `${$menuID}-child-${currentChild.key}` : null" :force-menu="true" :name="actionEntry.label" @@ -39,6 +41,7 @@