Skip to content

Commit

Permalink
Slight restructure?
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrambilla committed Jul 18, 2024
1 parent 5d06b0e commit 481e6b0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/js/unit/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ $(function() {
var $dropdown = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-cfw="dropdown"]');
var $input = $('<input type="text">').appendTo('#qunit-fixture');

$dropdown.CFW_Dropdown();

$dropdown.on('afterHide.cfw.dropdown', function() {
setTimeout(function() {
assert.ok($(document.activeElement).is($input), 'input focused');
Expand All @@ -467,12 +469,9 @@ $(function() {
});

$dropdown.on('afterShow.cfw.dropdown', function() {
setTimeout(function() {
$input[0].focus();
}, 100);
$input[0].focus();
});

$dropdown.CFW_Dropdown();
$dropdown.trigger('click');
});

Expand Down

0 comments on commit 481e6b0

Please sign in to comment.