Skip to content

Commit

Permalink
Does not show borders in addon block inputs (#5898)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleybl authored Apr 1, 2024
1 parent c256e4e commit 13d5d60
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ describe('Blocks Tests', () => {
cy.getSlate().click();
cy.get('.ui.basic.icon.button.block-add-button').click();
cy.get('.ui.basic.icon.button.image').contains('Image').click();
cy.get('.block-editor-image [tabindex="0"]')
.last()
.focus()
.should('have.css', 'outline', 'rgb(16, 16, 16) auto 1px');
cy.get('.block.image .ui.input input[type="text"]').type(
`https://github.com/plone/volto/raw/main/logos/volto-colorful.png{enter}`,
);
Expand Down
25 changes: 25 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-slate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe('Slate Block Tests', () => {
beforeEach(() => {
cy.intercept('GET', `/**/*?expand*`).as('content');
cy.intercept('GET', '/**/Document').as('schema');

// given a logged in editor and a page in edit mode
cy.autologin();
cy.createContent({
contentType: 'Document',
contentId: 'my-page',
contentTitle: 'My Page',
});
cy.visit('/my-page');
cy.wait('@content');

cy.navigate('/my-page/edit');
cy.wait('@schema');
});

it('No border in input', () => {
cy.get('.block-editor-slate [role=textbox]')
.click()
.should('have.css', 'outline', 'rgba(0, 0, 0, 0.87) none 0px');
});
});
8 changes: 8 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ describe('Table Block Tests', () => {
// Edit
cy.addNewBlock('table');
cy.wait(2000);

// No border in input
cy.get('.block-editor-slateTable [role=textbox]').should('be.visible');
cy.get('.block-editor-slateTable [role=textbox]')
.first()
.click()
.should('have.css', 'outline', 'rgb(135, 143, 147) none 0px');

cy.get(
'.celled.fixed.table thead tr th:first-child() [contenteditable="true"]',
)
Expand Down
25 changes: 25 additions & 0 deletions packages/volto/cypress/tests/core/blocks/blocks-title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe('Title Block Tests', () => {
beforeEach(() => {
cy.intercept('GET', `/**/*?expand*`).as('content');
cy.intercept('GET', '/**/Document').as('schema');

// given a logged in editor and a page in edit mode
cy.autologin();
cy.createContent({
contentType: 'Document',
contentId: 'my-page',
contentTitle: 'My Page',
});
cy.visit('/my-page');
cy.wait('@content');

cy.navigate('/my-page/edit');
cy.wait('@schema');
});

it('No border in input', () => {
cy.get('.block-editor-title [role=textbox]')
.click()
.should('have.css', 'outline', 'rgba(0, 0, 0, 0.87) none 0px');
});
});
1 change: 1 addition & 0 deletions packages/volto/news/5894.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Does not show borders in addon block inputs. @wesleybl
9 changes: 2 additions & 7 deletions packages/volto/theme/themes/pastanaga/extras/blocks.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@
border-color: rgba(120, 192, 215, 0.75);
}

.block-editor-title,
.block-editor-slate,
.block-editor-slateTable,
.slate-editor.selected {
:focus-visible {
outline: none;
}
[data-slate-editor='true'] {
outline: none;
}

.block .block:hover::before {
Expand Down

0 comments on commit 13d5d60

Please sign in to comment.