Fixes #3637 - Text Module widget is broken/hidden after pressing backspace (once).

This commit is contained in:
Rolf Schmidt 2021-06-29 14:19:09 +00:00 committed by Thorsten Eckel
parent ed74a78b99
commit cd8f74729b
2 changed files with 15 additions and 5 deletions

View file

@ -163,8 +163,11 @@
e.keyCode = e.which = keyCode;
}
// shift
if (e.keyCode === 16) return
// ignore invalid key codes if search is opened (issue #3637)
if (this.isActive() && e.keyCode === undefined) return
// skip on shift + arrow_keys
if (_.contains([16, 37, 38, 39, 40], e.keyCode)) return
// enter
if (e.keyCode === 13) {
@ -172,9 +175,6 @@
return
}
// arrow keys
if (e.keyCode === 37 || e.keyCode === 38 || e.keyCode === 39 || e.keyCode === 40) return
var newChar = String.fromCharCode(e.which)
// observe other keys

View file

@ -30,6 +30,16 @@ RSpec.shared_examples 'text modules' do |path:|
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
# give user access to all groups including those created