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 endless cycle #378

Merged
merged 1 commit into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions build/codex-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20012,17 +20012,23 @@ var Selection = function () {
*/
if (parent.tagName === tagName) {
/**
* Optional additional check for class-name matching
* Save the result
*/
parentTag = parent;

/**
* Optional additional check for class-name mismatching
*/
if (className && parent.classList && !parent.classList.contains(className)) {
continue;
parentTag = null;
}

/**
* If we have found required tag with class then save the result and go out from cycle
* If we have found required tag with class then go out from the cycle
*/
parentTag = parent;
break;
if (parentTag) {
break;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion build/codex-editor.js.map

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions src/components/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,23 @@ export default class Selection {
*/
if (parent.tagName === tagName) {
/**
* Optional additional check for class-name matching
* Save the result
*/
parentTag = parent;

/**
* Optional additional check for class-name mismatching
*/
if (className && parent.classList && !parent.classList.contains(className)) {
continue;
parentTag = null;
}

/**
* If we have found required tag with class then save the result and go out from cycle
* If we have found required tag with class then go out from the cycle
*/
parentTag = parent;
break;
if (parentTag) {
break;
}
}

/**
Expand Down