Focus editor when focusing widget and removed unnecessary code.
On editor blur blur widget that was focused.