Fixes #3637 - Text Module widget is broken/hidden after pressing backspace (once).
This commit is contained in:
parent
ed74a78b99
commit
cd8f74729b
2 changed files with 15 additions and 5 deletions
|
@ -163,8 +163,11 @@
|
||||||
e.keyCode = e.which = keyCode;
|
e.keyCode = e.which = keyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
// shift
|
// ignore invalid key codes if search is opened (issue #3637)
|
||||||
if (e.keyCode === 16) return
|
if (this.isActive() && e.keyCode === undefined) return
|
||||||
|
|
||||||
|
// skip on shift + arrow_keys
|
||||||
|
if (_.contains([16, 37, 38, 39, 40], e.keyCode)) return
|
||||||
|
|
||||||
// enter
|
// enter
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
|
@ -172,9 +175,6 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// arrow keys
|
|
||||||
if (e.keyCode === 37 || e.keyCode === 38 || e.keyCode === 39 || e.keyCode === 40) return
|
|
||||||
|
|
||||||
var newChar = String.fromCharCode(e.which)
|
var newChar = String.fromCharCode(e.which)
|
||||||
|
|
||||||
// observe other keys
|
// observe other keys
|
||||||
|
|
|
@ -30,6 +30,16 @@ RSpec.shared_examples 'text modules' do |path:|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not break search on backspace' do
|
||||||
|
visit path
|
||||||
|
within(:active_content) do
|
||||||
|
find('select[name="group_id"]').select(1)
|
||||||
|
find(:richtext).send_keys('@@agen')
|
||||||
|
find(:richtext).send_keys(:backspace)
|
||||||
|
expect(page).to have_no_text('No results found')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it 'supports group-dependent text modules' do
|
it 'supports group-dependent text modules' do
|
||||||
|
|
||||||
# give user access to all groups including those created
|
# give user access to all groups including those created
|
||||||
|
|
Loading…
Reference in a new issue