提交 b6792745 编写于 作者: A Alex Dima

Fixes Microsoft/monaco-editor#1255: Treat WKWebView the same as Safari around user-select

上级 344f4fa3
...@@ -146,7 +146,8 @@ export const isOpera = (userAgent.indexOf('Opera') >= 0); ...@@ -146,7 +146,8 @@ export const isOpera = (userAgent.indexOf('Opera') >= 0);
export const isFirefox = (userAgent.indexOf('Firefox') >= 0); export const isFirefox = (userAgent.indexOf('Firefox') >= 0);
export const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0); export const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0);
export const isChrome = (userAgent.indexOf('Chrome') >= 0); export const isChrome = (userAgent.indexOf('Chrome') >= 0);
export const isSafari = (userAgent.indexOf('Chrome') === -1) && (userAgent.indexOf('Safari') >= 0); export const isSafari = (!isChrome && (userAgent.indexOf('Safari') >= 0));
export const isWebkitWebView = (!isChrome && !isSafari && isWebKit);
export const isIPad = (userAgent.indexOf('iPad') >= 0); export const isIPad = (userAgent.indexOf('iPad') >= 0);
export const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0); export const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0);
......
...@@ -345,14 +345,9 @@ export class Configuration extends CommonEditorConfiguration { ...@@ -345,14 +345,9 @@ export class Configuration extends CommonEditorConfiguration {
private _getExtraEditorClassName(): string { private _getExtraEditorClassName(): string {
let extra = ''; let extra = '';
if (browser.isIE) { if (!browser.isSafari && !browser.isWebkitWebView) {
extra += 'ie '; // Use user-select: none in all browsers except Safari and native macOS WebView
} else if (browser.isFirefox) { extra += 'no-user-select ';
extra += 'ff ';
} else if (browser.isEdge) {
extra += 'edge ';
} else if (browser.isSafari) {
extra += 'safari ';
} }
if (platform.isMacintosh) { if (platform.isMacintosh) {
extra += 'mac '; extra += 'mac ';
......
...@@ -14,16 +14,9 @@ ...@@ -14,16 +14,9 @@
100% { background-color: none } 100% { background-color: none }
}*/ }*/
.monaco-editor.safari .lines-content, .monaco-editor.no-user-select .lines-content,
.monaco-editor.safari .view-line, .monaco-editor.no-user-select .view-line,
.monaco-editor.safari .view-lines { .monaco-editor.no-user-select .view-lines {
-webkit-user-select: text;
user-select: text;
}
.monaco-editor .lines-content,
.monaco-editor .view-line,
.monaco-editor .view-lines {
-webkit-user-select: none; -webkit-user-select: none;
-ms-user-select: none; -ms-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册