File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
src/lib/components/common Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 10051005 return true ;
10061006 }
10071007
1008- // Workaround for mobile WebViews that strip line breaks when pasting from
1009- // clipboard suggestions (e.g., Gboard clipboard history) .
1008+ // Workaround for mobile keyboards (e.g., Gboard) that may strip line breaks
1009+ // when pasting multi-line text from clipboard suggestions .
10101010 const isMobile = / Android| iPhone| iPad| iPod| Windows Phone/ i .test (
10111011 navigator .userAgent
10121012 );
1013- const isWebView =
1014- typeof window !== ' undefined' &&
1015- (/ wv/ i .test (navigator .userAgent ) || // Standard Android WebView flag
1016- (navigator .userAgent .includes (' Android' ) &&
1017- ! navigator .userAgent .includes (' Chrome' )) || // Other generic Android WebViews
1018- (navigator .userAgent .includes (' Safari' ) &&
1019- ! navigator .userAgent .includes (' Version' ))); // iOS WebView (in-app browsers)
1020-
1021- if (isMobile && isWebView && plainText .includes (' \n ' )) {
1013+
1014+ if (isMobile && plainText .includes (' \n ' )) {
10221015 // Manually deconstruct the pasted text and insert it with hard breaks
10231016 // to preserve the multi-line formatting.
10241017 const { state, dispatch } = view ;
You can’t perform that action at this time.
0 commit comments