Skip to content

Instantly share code, notes, and snippets.

@dfreedm
Created April 22, 2013 22:34
Show Gist options
  • Select an option

  • Save dfreedm/5439158 to your computer and use it in GitHub Desktop.

Select an option

Save dfreedm/5439158 to your computer and use it in GitHub Desktop.
Input cursor jumps on bound value
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Text Cursor Movement</title>
<script src="../../../MDV/mdv.js"></script>
</head>
<body>
<template id="template" bind="{{}}">
<input value="{{value}}">
</template>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
window.model = template.model = {value: 'hello'};
Model.notifyChanges();
});
</script>
<span style="white-space: pre-wrap;">
Place cursor before the 'h' and type.
The cursor should not jump to the end of the word.
</span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment