Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/blocks/ToggleWrapper/createToggleWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const createToggleWrapper = (

const toggleButton = document.createElement("button");
toggleButton.className = "bn-toggle-button";
toggleButton.type = "button";
toggleButton.innerHTML =
// https://fonts.google.com/icons?selected=Material+Symbols+Rounded:chevron_right:FILL@0;wght@700;GRAD@0;opsz@24&icon.query=chevron&icon.style=Rounded&icon.size=24&icon.color=%23e8eaed
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>';
Expand Down Expand Up @@ -75,6 +76,7 @@ export const createToggleWrapper = (

const toggleAddBlockButton = document.createElement("button");
toggleAddBlockButton.className = "bn-toggle-add-block-button";
toggleAddBlockButton.type = "button";
toggleAddBlockButton.textContent = "Empty toggle. Click to add a block.";
const toggleAddBlockButtonMouseDown = (event: MouseEvent) =>
event.preventDefault();
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/blocks/ToggleWrapper/ToggleWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const ToggleWrapper = (
<div className="bn-toggle-wrapper" data-show-children={showChildren}>
<button
className="bn-toggle-button"
type="button"
onMouseDown={(event) => event.preventDefault()}
onClick={() => handleToggle(editor.getBlock(block)!)}
>
Expand All @@ -129,6 +130,7 @@ export const ToggleWrapper = (
{showChildren && childCount === 0 && (
<button
className="bn-toggle-add-block-button"
type="button"
onClick={() => {
const updatedBlock = editor.updateBlock(block, {
// Single empty block with default type.
Expand Down
Loading