<NME> FocusMixin.js
<BEF> ADDFILE
<MSG> [changed] Move focus handling to Mixin for consistency

<DFF> @@ -0,0 +1,39 @@
+import { notify } from '../util/widgetHelpers';
+import { widgetEnabled } from '../util/interaction';
+import compat from '../util/compat';
+
+export default function FocusMixin({ willHandle, didHandle }) {
+  function handleFocus(inst, focused, event) {
+    let handler = inst.props[focused ? 'onFocus' : 'onBlur']
+
+    if (handler && event)
+      event.persist()
+
+    if (willHandle && willHandle.call(inst, focused, event) === false)
+      return
+
+    inst.setTimeout('focus', () => {
+      //compat.batchedUpdates(() => {
+        if (didHandle) didHandle.call(inst, focused, event)
+
+        if (focused !== inst.state.focused) {
+          notify(handler, event)
+          inst.setState({ focused })
+        }
+      //})
+    })
+  }
+
+  return {
+
+    @widgetEnabled
+    handleBlur(event) {
+      handleFocus(this, false, event)
+    },
+
+    @widgetEnabled
+    handleFocus(event) {
+      handleFocus(this, true, event)
+    }
+  }
+}

[changed] Move focus handling to Mixin for consistency