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() {
126126
127127 deleteToolbar ( )
128128 setTimeout ( ( ) => {
129- const selection = window . getSelection ( ) ?. toString ( ) . trim ( )
129+ const selection = window
130+ . getSelection ( )
131+ ?. toString ( )
132+ . trim ( )
133+ . replace ( / ^ - + | - + $ / g, '' )
130134 if ( selection ) {
131135 const inputElement = selectionElement . querySelector ( 'input, textarea' )
132136 let position
@@ -183,7 +187,11 @@ async function prepareForSelectionToolsTouch() {
183187
184188 deleteToolbar ( )
185189 setTimeout ( ( ) => {
186- const selection = window . getSelection ( ) ?. toString ( ) . trim ( )
190+ const selection = window
191+ . getSelection ( )
192+ ?. toString ( )
193+ . trim ( )
194+ . replace ( / ^ - + | - + $ / g, '' )
187195 if ( selection ) {
188196 toolbarContainer = createElementAtPosition (
189197 e . changedTouches [ 0 ] . pageX + 20 ,
You can’t perform that action at this time.
0 commit comments