Skip to content

fix(ie): Remove selection type check#574

Merged
mergify[bot] merged 1 commit intobox:masterfrom
mingzexiao6:fix-windows-3
Sep 2, 2020
Merged

fix(ie): Remove selection type check#574
mergify[bot] merged 1 commit intobox:masterfrom
mingzexiao6:fix-windows-3

Conversation

@mingzexiao6
Copy link
Contributor

No description provided.

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

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.

@mingzexiao6 mingzexiao6 changed the title fix(ie): Fix IE compatibility issues @mxiao6 fix(ie): Remove selection type check Sep 2, 2020
@mingzexiao6 mingzexiao6 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