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(ie): Remove selection type check #574

Merged
merged 1 commit into from
Sep 2, 2020
Merged

Conversation

mxiao6
Copy link
Contributor

@mxiao6 mxiao6 commented Sep 2, 2020

No description provided.

@mxiao6 mxiao6 requested a review from a team as a code owner September 2, 2020 15:53
@mxiao6
Copy link
Contributor Author

mxiao6 commented Sep 2, 2020

Will separate polyfill to a ts file.

}
}

export function isIE(): boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be avoided by checking for a different property on the selection and/or range(s)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at Selection.prototype and Range.prototype in IE console and didn't find any similar property, unfortunately

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is checking isCollapsed and rangeCount adequate? Can rangeCount be non-zero for a Caret selection?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually think isCollapsed itself is adequate. rangeCount is 1 for Caret selection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I find rangeCount is 0 for None type selection. So yeah I think we can remove type check.

@mxiao6 mxiao6 changed the title fix(ie): Fix IE compatibility issues @mxiao6 fix(ie): Remove selection type check Sep 2, 2020
@mxiao6 mxiao6 changed the title @mxiao6 fix(ie): Remove selection type check fix(ie): Remove selection type check Sep 2, 2020
@mergify mergify bot merged commit 53b00bd into box:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants