Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Highlight selection on Surface #326

Merged
merged 6 commits into from
Jan 25, 2019
Merged

Fix: Highlight selection on Surface #326

merged 6 commits into from
Jan 25, 2019

Conversation

pramodsum
Copy link
Contributor

@pramodsum pramodsum commented Jan 23, 2019

  • Only reset highlight selection on selectionchange event on touch enabled devices when the user is NOT creating a highlight annotation

  • tests

- Do not reset highlight selection on 'selectionchange' event on touch enabled devices when the user is creating a highlight annotation
@boxcla
Copy link

boxcla commented Jan 23, 2019

Verified that @pramodsum has signed the CLA. Thanks for the pull request!

src/doc/DocAnnotator.js Show resolved Hide resolved

// Do nothing if in a text area or mobile dialog or mobile create dialog is already open
const pointController = this.modeControllers[TYPES.point];
const isCreatingPoint = !!(pointController && pointController.pendingThreadID);
const isPopoverActive = !!util.findClosestElWithClass(document.activeElement, CLASS_ANNOTATION_POPOVER);
if (this.isCreatingHighlight || isCreatingPoint || isPopoverActive) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should re-show the create dialog on selection change so that the position updates

@@ -577,7 +579,7 @@ class DocAnnotator extends Annotator {
}

this.selectionEndTimeout = setTimeout(() => {
if (this.createHighlightDialog && !this.createHighlightDialog.isVisible) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensures create dialog is re-positioned on timeout

src/doc/DocAnnotator.js Outdated Show resolved Hide resolved
src/doc/DocAnnotator.js Show resolved Hide resolved
src/doc/DocAnnotator.js Outdated Show resolved Hide resolved
jeremypress
jeremypress previously approved these changes Jan 25, 2019
@pramodsum pramodsum merged commit 6a3b83a into box:master Jan 25, 2019
pramodsum added a commit to JustinHoldstock/box-content-preview that referenced this pull request Jan 25, 2019
https://github.com/box/box-annotations/releases/tag/v3.7.1

* Update Translations (box#328) ([39805b8](box/box-annotations@39805b8)), closes [box#328](box/box-annotations#328)
* Chore: Add escape hotkey on AnnotationPopover (box#327) ([e92ec85](box/box-annotations@e92ec85)), closes [box#327](box/box-annotations#327)
* Fix: Highlight selection on Surface (box#326) ([6a3b83a](box/box-annotations@6a3b83a)), closes [box#326](box/box-annotations#326)
* Fix: Import correct styling for flyout component (box#325) ([14d65f6](box/box-annotations@14d65f6)), closes [box#325](box/box-annotations#325)
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.

3 participants