Update Selection.js

Bugfix for an error/crash that sometimes happens when trying to use the editor in Internet Explorer.