File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,11 @@ async function prepareForSelectionTools() {
126
126
127
127
deleteToolbar ( )
128
128
setTimeout ( ( ) => {
129
- const selection = window . getSelection ( ) ?. toString ( ) . trim ( )
129
+ const selection = window
130
+ . getSelection ( )
131
+ ?. toString ( )
132
+ . trim ( )
133
+ . replace ( / ^ - + | - + $ / g, '' )
130
134
if ( selection ) {
131
135
const inputElement = selectionElement . querySelector ( 'input, textarea' )
132
136
let position
@@ -183,7 +187,11 @@ async function prepareForSelectionToolsTouch() {
183
187
184
188
deleteToolbar ( )
185
189
setTimeout ( ( ) => {
186
- const selection = window . getSelection ( ) ?. toString ( ) . trim ( )
190
+ const selection = window
191
+ . getSelection ( )
192
+ ?. toString ( )
193
+ . trim ( )
194
+ . replace ( / ^ - + | - + $ / g, '' )
187
195
if ( selection ) {
188
196
toolbarContainer = createElementAtPosition (
189
197
e . changedTouches [ 0 ] . pageX + 20 ,
You can’t perform that action at this time.
0 commit comments