Skip to content

Commit ed54ce1

Browse files
authored
Merge branch 'v4-dev' into v4-navbar-fixed-class
2 parents 93d745e + 04b8219 commit ed54ce1

File tree

24 files changed

+974
-1733
lines changed

24 files changed

+974
-1733
lines changed

bundlesize.config.json renamed to .bundlewatch.config.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,11 @@
4040
"path": "./dist/js/bootstrap.min.js",
4141
"maxSize": "14.75 kB"
4242
}
43-
]
43+
],
44+
"ci": {
45+
"trackBranches": [
46+
"master",
47+
"v4-dev"
48+
]
49+
}
4450
}

.dependabot/config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# https://dependabot.com/docs/config-file/
2+
version: 1
3+
update_configs:
4+
- package_manager: "javascript"
5+
directory: "/"
6+
update_schedule: "monthly"
7+
target_branch: "v4-dev"
8+
default_reviewers:
9+
- "XhmikosR"
10+
default_labels:
11+
- "dependencies"
12+
- "v4"
13+
version_requirement_updates: "increase_versions"
14+
- package_manager: "ruby:bundler"
15+
directory: "/"
16+
update_schedule: "monthly"
17+
target_branch: "v4-dev"
18+
default_reviewers:
19+
- "XhmikosR"
20+
default_labels:
21+
- "dependencies"
22+
- "v4"
23+
version_requirement_updates: "increase_versions"

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ jobs:
6969
- name: Run tests
7070
run: npm test
7171

72-
- name: Run bundlesize
73-
run: npm run bundlesize
72+
- name: Run bundlewatch
73+
run: npm run bundlewatch
7474
if: matrix.node == 10
7575
env:
76-
BUNDLESIZE_GITHUB_TOKEN: "${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}"
76+
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
7777

7878
- name: Run BrowserStack tests
7979
run: npm run js-test-cloud

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ GEM
5757
mini_portile2 (~> 2.4.0)
5858
pathutil (0.16.2)
5959
forwardable-extended (~> 2.6)
60-
public_suffix (4.0.3)
60+
public_suffix (4.0.4)
6161
rb-fsevent (0.10.3)
6262
rb-inotify (0.10.1)
6363
ffi (~> 1.0)

js/src/dropdown.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,6 @@ class Dropdown {
452452
return
453453
}
454454

455-
event.preventDefault()
456-
event.stopPropagation()
457-
458455
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
459456
return
460457
}
@@ -466,6 +463,9 @@ class Dropdown {
466463
return
467464
}
468465

466+
event.preventDefault()
467+
event.stopPropagation()
468+
469469
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
470470
if (event.which === ESCAPE_KEYCODE) {
471471
const toggle = parent.querySelector(SELECTOR_DATA_TOGGLE)

js/tests/unit/dropdown.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,70 @@ $(function () {
10201020
$textarea.trigger('click')
10211021
})
10221022

1023+
QUnit.test('should not stop key event propagation when dropdown is disabled', function (assert) {
1024+
assert.expect(1)
1025+
var done = assert.async()
1026+
1027+
var dropdownHTML = '<div class="tabs">' +
1028+
'<div class="dropdown">' +
1029+
'<a href="#" class="dropdown-toggle" id="toggle" data-toggle="dropdown" disabled>Dropdown</a>' +
1030+
'<div class="dropdown-menu">' +
1031+
'<a class="dropdown-item" id="item" href="#">Menu item</a>' +
1032+
'</div>' +
1033+
'</div>'
1034+
1035+
var $dropdown = $(dropdownHTML)
1036+
.appendTo('#qunit-fixture')
1037+
.find('[data-toggle="dropdown"]')
1038+
.bootstrapDropdown()
1039+
1040+
var $body = $('body')
1041+
1042+
$(document).on('keydown', function () {
1043+
$body.addClass('event-handled')
1044+
})
1045+
1046+
// Key escape
1047+
$dropdown.trigger('focus').trigger($.Event('keydown', {
1048+
which: 27
1049+
}))
1050+
1051+
assert.ok($body.hasClass('event-handled'), 'ESC key event was propagated')
1052+
done()
1053+
})
1054+
1055+
QUnit.test('should not stop ESC key event propagation when dropdown is not active', function (assert) {
1056+
assert.expect(1)
1057+
var done = assert.async()
1058+
1059+
var dropdownHTML = '<div class="tabs">' +
1060+
'<div class="dropdown">' +
1061+
'<a href="#" class="dropdown-toggle" id="toggle" data-toggle="dropdown">Dropdown</a>' +
1062+
'<div class="dropdown-menu">' +
1063+
'<a class="dropdown-item" id="item" href="#">Menu item</a>' +
1064+
'</div>' +
1065+
'</div>'
1066+
1067+
var $dropdown = $(dropdownHTML)
1068+
.appendTo('#qunit-fixture')
1069+
.find('[data-toggle="dropdown"]')
1070+
.bootstrapDropdown()
1071+
1072+
var $body = $('body')
1073+
1074+
$(document).on('keydown', function () {
1075+
$body.addClass('event-handled')
1076+
})
1077+
1078+
// Key escape
1079+
$dropdown.trigger('focus').trigger($.Event('keydown', {
1080+
which: 27
1081+
}))
1082+
1083+
assert.ok($body.hasClass('event-handled'), 'ESC key event was propagated')
1084+
done()
1085+
})
1086+
10231087
QUnit.test('should not use Popper.js if display set to static', function (assert) {
10241088
assert.expect(1)
10251089
var dropdownHTML =

js/tests/unit/tab.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ $(function () {
143143
QUnit.test('should not fire shown when tab is already active', function (assert) {
144144
assert.expect(0)
145145
var tabsHTML = '<ul class="nav nav-tabs" role="tablist">' +
146-
'<li class="nav-item"><a href="#home" class="nav-link active" role="tab">Home</a></li>' +
147-
'<li class="nav-item"><a href="#profile" class="nav-link" role="tab">Profile</a></li>' +
146+
'<li class="nav-item" role="presentation"><a href="#home" class="nav-link active" role="tab">Home</a></li>' +
147+
'<li class="nav-item" role="presentation"><a href="#profile" class="nav-link" role="tab">Profile</a></li>' +
148148
'</ul>' +
149149
'<div class="tab-content">' +
150150
'<div class="tab-pane active" id="home" role="tabpanel"></div>' +
@@ -387,8 +387,8 @@ $(function () {
387387
assert.expect(6)
388388
var done = assert.async()
389389
var tabsHTML = '<ul class="nav nav-tabs" role="tablist">' +
390-
'<li class="nav-item"><a id="tab-home" href="#home" class="nav-link" data-toggle="tab" role="tab">Home</a></li>' +
391-
'<li class="nav-item"><a id="tab-profile" href="#profile" class="nav-link" data-toggle="tab" role="tab">Profile</a></li>' +
390+
'<li class="nav-item" role="presentation"><a id="tab-home" href="#home" class="nav-link" data-toggle="tab" role="tab">Home</a></li>' +
391+
'<li class="nav-item" role="presentation"><a id="tab-profile" href="#profile" class="nav-link" data-toggle="tab" role="tab">Profile</a></li>' +
392392
'</ul>' +
393393
'<div class="tab-content">' +
394394
'<div class="tab-pane fade" id="home" role="tabpanel"></div>' +
@@ -421,17 +421,17 @@ $(function () {
421421

422422
var html = [
423423
'<ul class="nav nav-tabs" role="tablist">',
424-
' <li class="nav-item">',
424+
' <li class="nav-item" role="presentation">',
425425
' <a class="nav-link nav-tab" href="#profile" role="tab" data-toggle="tab">',
426426
' <button class="close"><span aria-hidden="true">&times;</span></button>',
427427
' </a>',
428428
' </li>',
429-
' <li class="nav-item">',
429+
' <li class="nav-item" role="presentation">',
430430
' <a id="secondNav" class="nav-link nav-tab" href="#buzz" role="tab" data-toggle="tab">',
431431
' <button class="close"><span aria-hidden="true">&times;</span></button>',
432432
' </a>',
433433
' </li>',
434-
' <li class="nav-item">',
434+
' <li class="nav-item" role="presentation">',
435435
' <a class="nav-link nav-tab" href="#references" role="tab" data-toggle="tab">',
436436
' <button id="btnClose" class="close"><span aria-hidden="true">&times;</span></button>',
437437
' </a>',
@@ -466,14 +466,14 @@ $(function () {
466466

467467
var html = [
468468
'<ul class="nav nav-tabs" role="tablist">',
469-
' <li class="nav-item">',
469+
' <li class="nav-item" role="presentation">',
470470
' <a class="nav-link nav-tab" href="#home" role="tab" data-toggle="tab">Home</a>',
471471
' </li>',
472-
' <li class="nav-item">',
472+
' <li class="nav-item" role="presentation">',
473473
' <a id="secondNav" class="nav-link nav-tab" href="#profile" role="tab" data-toggle="tab">Profile</a>',
474474
' </li>',
475475
'</ul>',
476-
'<div class="tab-content">',
476+
'<div class="tab-content" role="presentation">',
477477
' <div role="tabpanel" class="tab-pane" id="home">test 1</div>',
478478
' <div role="tabpanel" class="tab-pane" id="profile">test 2</div>',
479479
'</div>'
@@ -494,10 +494,10 @@ $(function () {
494494

495495
var html = [
496496
'<ul class="nav nav-tabs" role="tablist">',
497-
' <li class="nav-item">',
497+
' <li class="nav-item" role="presentation">',
498498
' <a class="nav-link nav-tab" href="#home" role="tab" data-toggle="tab">Home</a>',
499499
' </li>',
500-
' <li class="nav-item">',
500+
' <li class="nav-item" role="presentation">',
501501
' <a id="secondNav" class="nav-link nav-tab" href="#profile" role="tab" data-toggle="tab">Profile</a>',
502502
' </li>',
503503
'</ul>',

js/tests/visual/collapse.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<h1>Collapse <small>Bootstrap Visual Test</small></h1>
1212

1313
<div id="accordion" role="tablist">
14-
<div class="card">
14+
<div class="card" role="presentation">
1515
<div class="card-header" role="tab" id="headingOne">
1616
<h5 class="mb-0">
1717
<a data-toggle="collapse" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
@@ -26,7 +26,7 @@ <h5 class="mb-0">
2626
</div>
2727
</div>
2828
</div>
29-
<div class="card">
29+
<div class="card" role="presentation">
3030
<div class="card-header" role="tab" id="headingTwo">
3131
<h5 class="mb-0">
3232
<a class="collapsed" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
@@ -40,7 +40,7 @@ <h5 class="mb-0">
4040
</div>
4141
</div>
4242
</div>
43-
<div class="card">
43+
<div class="card" role="presentation">
4444
<div class="card-header" role="tab" id="headingThree">
4545
<h5 class="mb-0">
4646
<a class="collapsed" data-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
@@ -54,7 +54,7 @@ <h5 class="mb-0">
5454
</div>
5555
</div>
5656
</div>
57-
<div class="card">
57+
<div class="card" role="presentation">
5858
<div class="card-header" role="tab" id="headingFour">
5959
<h5 class="mb-0">
6060
<a class="collapsed" data-toggle="collapse" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">

js/tests/visual/modal.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h4>Tooltips in a modal</h4>
5555
<p><a href="#" data-toggle="tooltip" data-placement="top" title="Tooltip on top">This link</a> and <a href="#" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">that link</a> should have tooltips on hover.</p>
5656

5757
<div id="accordion" role="tablist">
58-
<div class="card">
58+
<div class="card" role="presentation">
5959
<div class="card-header" role="tab" id="headingOne">
6060
<h5 class="mb-0">
6161
<a data-toggle="collapse" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
@@ -70,7 +70,7 @@ <h5 class="mb-0">
7070
</div>
7171
</div>
7272
</div>
73-
<div class="card">
73+
<div class="card" role="presentation">
7474
<div class="card-header" role="tab" id="headingTwo">
7575
<h5 class="mb-0">
7676
<a class="collapsed" data-toggle="collapse" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
@@ -84,7 +84,7 @@ <h5 class="mb-0">
8484
</div>
8585
</div>
8686
</div>
87-
<div class="card">
87+
<div class="card" role="presentation">
8888
<div class="card-header" role="tab" id="headingThree">
8989
<h5 class="mb-0">
9090
<a class="collapsed" data-toggle="collapse" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">

js/tests/visual/tab.html

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@ <h1>Tab <small>Bootstrap Visual Test</small></h1>
1818
<h4>Tabs without fade</h4>
1919

2020
<ul class="nav nav-tabs" role="tablist">
21-
<li class="nav-item">
21+
<li class="nav-item" role="presentation">
2222
<a class="nav-link active" data-toggle="tab" href="#home" role="tab">Home</a>
2323
</li>
24-
<li class="nav-item">
24+
<li class="nav-item" role="presentation">
2525
<a class="nav-link" data-toggle="tab" href="#profile" role="tab">Profile</a>
2626
</li>
27-
<li class="nav-item dropdown">
28-
<a class="nav-link dropdown-toggle" href="#" id="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
29-
<div class="dropdown-menu" aria-labelledby="dropdown">
30-
<a class="dropdown-item" data-toggle="tab" href="#fat" role="tab">@fat</a>
31-
<a class="dropdown-item" data-toggle="tab" href="#mdo" role="tab">@mdo</a>
32-
</div>
27+
<li class="nav-item" role="presentation">
28+
<a class="nav-link" data-toggle="tab" href="#fat" role="tab">@fat</a>
29+
</li>
30+
<li class="nav-item" role="presentation">
31+
<a class="nav-link" data-toggle="tab" href="#mdo" role="tab">@mdo</a>
3332
</li>
3433
</ul>
3534

@@ -55,18 +54,17 @@ <h4>Tabs without fade</h4>
5554
<h4>Tabs with fade</h4>
5655

5756
<ul class="nav nav-tabs" role="tablist">
58-
<li class="nav-item">
57+
<li class="nav-item" role="presentation">
5958
<a class="nav-link active" data-toggle="tab" href="#home2" role="tab">Home</a>
6059
</li>
61-
<li class="nav-item">
60+
<li class="nav-item" role="presentation">
6261
<a class="nav-link" data-toggle="tab" href="#profile2" role="tab">Profile</a>
6362
</li>
64-
<li class="nav-item dropdown">
65-
<a class="nav-link dropdown-toggle" href="#" id="dropdown2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
66-
<div class="dropdown-menu" aria-labelledby="dropdown2">
67-
<a class="dropdown-item" data-toggle="tab" href="#fat2" role="tab">@fat</a>
68-
<a class="dropdown-item" data-toggle="tab" href="#mdo2" role="tab">@mdo</a>
69-
</div>
63+
<li class="nav-item" role="presentation">
64+
<a class="nav-link" data-toggle="tab" href="#fat2" role="tab">@fat</a>
65+
</li>
66+
<li class="nav-item" role="presentation">
67+
<a class="nav-link" data-toggle="tab" href="#mdo2" role="tab">@mdo</a>
7068
</li>
7169
</ul>
7270

@@ -92,18 +90,17 @@ <h4>Tabs with fade</h4>
9290
<h4>Tabs without fade (no initially active pane)</h4>
9391

9492
<ul class="nav nav-tabs" role="tablist">
95-
<li class="nav-item">
93+
<li class="nav-item" role="presentation">
9694
<a class="nav-link" data-toggle="tab" href="#home3" role="tab">Home</a>
9795
</li>
98-
<li class="nav-item">
96+
<li class="nav-item" role="presentation">
9997
<a class="nav-link" data-toggle="tab" href="#profile3" role="tab">Profile</a>
10098
</li>
101-
<li class="nav-item dropdown">
102-
<a class="nav-link dropdown-toggle" href="#" id="dropdown3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
103-
<div class="dropdown-menu" aria-labelledby="dropdown3">
104-
<a class="dropdown-item" data-toggle="tab" href="#fat3" role="tab">@fat</a>
105-
<a class="dropdown-item" data-toggle="tab" href="#mdo3" role="tab">@mdo</a>
106-
</div>
99+
<li class="nav-item" role="presentation">
100+
<a class="nav-link" data-toggle="tab" href="#fat3" role="tab">@fat</a>
101+
</li>
102+
<li class="nav-item" role="presentation">
103+
<a class="nav-link" data-toggle="tab" href="#mdo3" role="tab">@mdo</a>
107104
</li>
108105
</ul>
109106

@@ -129,18 +126,17 @@ <h4>Tabs without fade (no initially active pane)</h4>
129126
<h4>Tabs with fade (no initially active pane)</h4>
130127

131128
<ul class="nav nav-tabs" role="tablist">
132-
<li class="nav-item">
129+
<li class="nav-item" role="presentation">
133130
<a class="nav-link" data-toggle="tab" href="#home4" role="tab">Home</a>
134131
</li>
135-
<li class="nav-item">
132+
<li class="nav-item" role="presentation">
136133
<a class="nav-link" data-toggle="tab" href="#profile4" role="tab">Profile</a>
137134
</li>
138-
<li class="nav-item dropdown">
139-
<a class="nav-link dropdown-toggle" href="#" id="dropdown4" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
140-
<div class="dropdown-menu" aria-labelledby="dropdown4">
141-
<a class="dropdown-item" data-toggle="tab" href="#fat4" role="tab">@fat</a>
142-
<a class="dropdown-item" data-toggle="tab" href="#mdo4" role="tab">@mdo</a>
143-
</div>
135+
<li class="nav-item" role="presentation">
136+
<a class="nav-link" data-toggle="tab" href="#fat4" role="tab">@fat</a>
137+
</li>
138+
<li class="nav-item" role="presentation">
139+
<a class="nav-link" data-toggle="tab" href="#mdo4" role="tab">@mdo</a>
144140
</li>
145141
</ul>
146142

0 commit comments

Comments
 (0)