File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
core/src/blocks/ToggleWrapper
react/src/blocks/ToggleWrapper Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export const createToggleWrapper = (
41
41
42
42
const toggleButton = document . createElement ( "button" ) ;
43
43
toggleButton . className = "bn-toggle-button" ;
44
+ toggleButton . type = "button" ;
44
45
toggleButton . innerHTML =
45
46
// 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
46
47
'<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>' ;
@@ -75,6 +76,7 @@ export const createToggleWrapper = (
75
76
76
77
const toggleAddBlockButton = document . createElement ( "button" ) ;
77
78
toggleAddBlockButton . className = "bn-toggle-add-block-button" ;
79
+ toggleAddBlockButton . type = "button" ;
78
80
toggleAddBlockButton . textContent = "Empty toggle. Click to add a block." ;
79
81
const toggleAddBlockButtonMouseDown = ( event : MouseEvent ) =>
80
82
event . preventDefault ( ) ;
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ export const ToggleWrapper = (
110
110
< div className = "bn-toggle-wrapper" data-show-children = { showChildren } >
111
111
< button
112
112
className = "bn-toggle-button"
113
+ type = "button"
113
114
onMouseDown = { ( event ) => event . preventDefault ( ) }
114
115
onClick = { ( ) => handleToggle ( editor . getBlock ( block ) ! ) }
115
116
>
@@ -129,6 +130,7 @@ export const ToggleWrapper = (
129
130
{ showChildren && childCount === 0 && (
130
131
< button
131
132
className = "bn-toggle-add-block-button"
133
+ type = "button"
132
134
onClick = { ( ) => {
133
135
const updatedBlock = editor . updateBlock ( block , {
134
136
// Single empty block with default type.
You can’t perform that action at this time.
0 commit comments