Skip to content

Drag and drop styles#14

Merged
chandlerprall merged 3 commits intochandlerprall:feature/markdown-editor-drag-n-dropfrom
elizabetdev:feature/markdown-editor-drag-n-drop
Jul 29, 2020
Merged

Drag and drop styles#14
chandlerprall merged 3 commits intochandlerprall:feature/markdown-editor-drag-n-dropfrom
elizabetdev:feature/markdown-editor-drag-n-drop

Conversation

@elizabetdev
Copy link
Copy Markdown
Collaborator

There are a few inconsistencies across browsers.

The following code that starts on line 86 of the markdown_editor_drop_zone.tsx makes the drag and drop file not accepted don't work on Safari.

accept: dropHandlers.reduce<string[]>((accept, dropHandler) => {
  accept.push(...dropHandler.supportedFiles);
  return accept;
}, []),
  • I changed the background to blue when we're dragging a file. In Safari without the above code, the blue (.euiMarkdownEditorDropZone--isDragging) would always appear. And then if a file was not accepted the footer error would appear. So having blue and that error in red makes more sense than green and red. So we just assume the blue as an isDragging action rather than success.
  • The .euiMarkdownEditorDropZone--isDraggingError is a red background and it disappears once we stop dragging an unaccepted file.
  • The .euiMarkdownEditorDropZone--hasError' is the footer error and it stays there until we focus the textarea or try to upload/drag a new file.

@chandlerprall chandlerprall merged commit efefc77 into chandlerprall:feature/markdown-editor-drag-n-drop Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants