浏览代码

Merge pull request #388 from ckeditor/t/ckedtor5/920b

Fix: The action should be executed upon the first click on a tooltip-enabled UI in iOS. Closes ckeditor/ckeditor5#920.
Piotrek Koszuliński 7 年之前
父节点
当前提交
fbf76e98a6
共有 1 个文件被更改,包括 20 次插入0 次删除
  1. 20 0
      packages/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css

+ 20 - 0
packages/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css

@@ -10,6 +10,26 @@
 @define-mixin ck-tooltip_enabled {
 	& .ck-tooltip {
 		display: block;
+
+		/*
+		 * Don't display tooltips in devices which don't support :hover.
+		 * In fact, it's all about iOS, which forces user to click UI elements twice to execute
+		 * the primary action, when tooltips are enabled.
+		 *
+		 * Q: OK, but why not the following query?
+		 *
+		 *   @media (hover) {
+		 *       display: block;
+		 *   }
+		 *
+		 * A: Because FF does not support it and it would completely disable tooltips
+		 * in that browser.
+		 *
+		 * More in https://github.com/ckeditor/ckeditor5/issues/920.
+		 */
+		@media (hover:none) {
+			display: none;
+		}
 	}
 }