mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 05:46:46 +02:00
Compare commits
2 commits
238c909016
...
bd1de56ef3
Author | SHA1 | Date | |
---|---|---|---|
bd1de56ef3 | |||
8276daa5ca |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@editorjs/editorjs",
|
||||
"version": "2.30.0-rc.8",
|
||||
"version": "2.30.0-rc.9",
|
||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||
"main": "dist/editorjs.umd.js",
|
||||
"module": "dist/editorjs.mjs",
|
||||
|
|
|
@ -249,6 +249,13 @@ export default class BlockEvents extends Module {
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Toolbox will be opened with immediate focus on the Search input,
|
||||
* and '/' will be added in the search input by default — we need to prevent it and add '/' manually
|
||||
*/
|
||||
event.preventDefault();
|
||||
this.Editor.Caret.insertContentAtCaretPosition('/');
|
||||
|
||||
this.activateToolbox();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
describe('Slash keydown', function () {
|
||||
describe('pressed in empty block', function () {
|
||||
it('should open Toolbox', () => {
|
||||
it('should add "/" in a block and open Toolbox', () => {
|
||||
cy.createEditor({
|
||||
data: {
|
||||
blocks: [
|
||||
|
@ -19,6 +19,14 @@ describe('Slash keydown', function () {
|
|||
.click()
|
||||
.type('/');
|
||||
|
||||
/**
|
||||
* Block content should contain slash
|
||||
*/
|
||||
cy.get('[data-cy=editorjs]')
|
||||
.find('.ce-paragraph')
|
||||
.invoke('text')
|
||||
.should('eq', '/');
|
||||
|
||||
cy.get('[data-cy="toolbox"] .ce-popover__container')
|
||||
.should('be.visible');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue