Reputation: 1289
I want to use focus/blur events to show/hide an area containing a textarea.
In my template:
<div class="area">
<textarea/>
<div class="actions">
<div class="action"/>
</div>
</div>
In my Backbone Marionette view:
events: {
'focus .area': 'onFocus',
'blur .area': 'onBlur',
'click .action': 'onAction'
},
Why the focus does not work on my template when I do click on .zone
div (but in the textarea
instead) ? And why the click event is never executed (but the blur is instead) ?
Upvotes: 0
Views: 604
Reputation: 1289
The solution I found is to add tabIndex
and make div.area
as a form component:
<div class="area" tabIndex="0">
<textarea/>
<div class="actions">
<div class="action"/>
</div>
</div>
Upvotes: 0