TimeSeries: Support Ctrl key for marking annotations (#38034) (#38035)

(cherry picked from commit 646d95b8fb)

Co-authored-by: Villena Guillaume <guillaume@villena.me>
This commit is contained in:
Grot (@grafanabot)
2021-08-18 17:10:51 -05:00
committed by GitHub
co-authored by Villena Guillaume
parent 73f0217abf
commit c760ca90db
@@ -83,7 +83,7 @@ export const AnnotationEditorPlugin: React.FC<AnnotationEditorPluginProps> = ({
mousedown: (u, targ, handler) => (e) => {
if (e.button === 0) {
handler(e);
if (e.metaKey) {
if (e.metaKey || e.ctrlKey) {
isClick = true;
annotating = true;
}
@@ -95,7 +95,7 @@ export const AnnotationEditorPlugin: React.FC<AnnotationEditorPluginProps> = ({
if (e.button === 0) {
handler(e);
// handle cmd+drag
if (e.metaKey) {
if (e.metaKey || e.ctrlKey) {
isClick = false;
annotating = true;
}
@@ -105,7 +105,7 @@ export const AnnotationEditorPlugin: React.FC<AnnotationEditorPluginProps> = ({
},
mouseup: (u, targ, handler) => (e) => {
// handle cmd+click
if (isClick && u.cursor.left && e.button === 0 && e.metaKey) {
if (isClick && u.cursor.left && e.button === 0 && (e.metaKey || e.ctrlKey)) {
u.setSelect({ left: u.cursor.left, width: 0, top: 0, height: 0 });
annotating = true;
}