If a user uses keyboard to navigate in the app, it should be possible for her to tab onto an item, hit spacebar to select it. If a space bar is hit again the very same item should be deselected.
This is an requirement that tests whether frameworks provide good UX by default. Many use innerHTML to update a whole chunk of DOM, which is destructive and causes focus / text selection and other properties of DOM subtree that is being replaced to be lost.
In contrast to innerHTML AngularJS and I believe Ember and Knockout use fine-grained dom manipulation which avoids this pitfall.
Any ideas on how to solve this with String-based templating? Which most frameworks use.
Could probably use Mutation Observers to see if the document.activeElement is modified and if so, refocus it.