π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WIKI-602] chore: disable image alignment tooltip for touch devices (#7642)
Lakhan Bahetieb5ac2fc2d56
diff --git a/packages/editor/src/core/extensions/custom-image/components/toolbar/alignment.tsx b/packages/editor/src/core/extensions/custom-image/components/toolbar/alignment.tsxindex 3790fa5471..dbbc42e4cf 100644--- a/packages/editor/src/core/extensions/custom-image/components/toolbar/alignment.tsx+++ b/packages/editor/src/core/extensions/custom-image/components/toolbar/alignment.tsx@@ -10,11 +10,12 @@ import { IMAGE_ALIGNMENT_OPTIONS } from "../../utils";type Props = {activeAlignment: TCustomImageAlignment;handleChange: (alignment: TCustomImageAlignment) => void;+ isTouchDevice: boolean;toggleToolbarViewStatus: (val: boolean) => void;};export const ImageAlignmentAction: React.FC<Props> = (props) => {- const { activeAlignment, handleChange, toggleToolbarViewStatus } = props;+ const { activeAlignment, handleChange, isTouchDevice, toggleToolbarViewStatus } = props;// statesconst [isDropdownOpen, setIsDropdownOpen] = useState(false);// refs@@ -30,7 +31,7 @@ export const ImageAlignmentAction: React.FC<Props> = (props) => {return (<div ref={dropdownRef} className="h-full relative">- <Tooltip tooltipContent="Align">+ <Tooltip disabled={isTouchDevice} tooltipContent="Align"><buttontype="button"className="h-full flex items-center gap-1 text-white/60 hover:text-white transition-colors"@@ -43,7 +44,7 @@ export const ImageAlignmentAction: React.FC<Props> = (props) => {{isDropdownOpen && (<div className="absolute top-full left-1/2 -translate-x-1/2 mt-0.5 h-7 bg-black/80 flex items-center gap-2 px-2 rounded">{IMAGE_ALIGNMENT_OPTIONS.map((option) => (- <Tooltip key={option.value} tooltipContent={option.label}>+ <Tooltip disabled={isTouchDevice} key={option.value} tooltipContent={option.label}><buttontype="button"className="flex-shrink-0 h-full grid place-items-center text-white/60 hover:text-white transition-colors"diff --git a/packages/editor/src/core/extensions/custom-image/components/toolbar/root.tsx b/packages/editor/src/core/extensions/custom-image/components/toolbar/root.tsxindex 297e3b46b9..1011050de7 100644--- a/packages/editor/src/core/extensions/custom-image/components/toolbar/root.tsx+++ b/packages/editor/src/core/extensions/custom-image/components/toolbar/root.tsx@@ -42,6 +42,7 @@ export const ImageToolbarRoot: React.FC<Props> = (props) => {<ImageAlignmentActionactiveAlignment={alignment}handleChange={handleAlignmentChange}+ isTouchDevice={isTouchDevice}toggleToolbarViewStatus={setShouldShowToolbar}/>)}diff --git a/packages/editor/src/styles/editor.css b/packages/editor/src/styles/editor.cssindex e4aabde9ec..fa9d9521f1 100644--- a/packages/editor/src/styles/editor.css+++ b/packages/editor/src/styles/editor.css@@ -500,3 +500,9 @@ span[data-name][data-type="emoji"] img {max-width: 1.25em;max-height: 1.25em;}++/* touch device styles */+.touch-select-none {+ user-select: none;+ -webkit-user-select: none;+}