sdr_view_components 0.23.1 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3102801d311a012457cd19a83738bbcac342156ec8c29e0d4fa47e772785b38
4
- data.tar.gz: 3fd97897e0a627b545bfd522d7563bbb46b47c48349a2d623c03aeb8c65286b4
3
+ metadata.gz: 706db14b9a3757c7f305dcd907da48caa8e7b7e832f88cfe4d5b9cc1a4b80547
4
+ data.tar.gz: 4e567ebedf3df411ca10ef7f44bcd425323b247e0c51ed5438f57e08e02e421e
5
5
  SHA512:
6
- metadata.gz: b0a243260da7907878cd72fc031bf020c5e6579c29856eecaf957a4fa9ec6254c68745138f0189baf4588c2de2ab00b872653213927d854d6ddfb2dd9335101c
7
- data.tar.gz: 3d20e40b35b6751d7ce5647b4f422c63e72d4deced01566032f1987958ff34a235f52fb5da536767bccca9631d29df41905a67eda4a58eeea98bdb88adae6504
6
+ metadata.gz: dc58042cb98d8f2db5e87b2a6289dc566d36ec991ffb12a99378794b3a1e193f1bc3b60a65ce282a60a1ec9a447222da3722ace2286aa5e9340ab73047c4fb6e
7
+ data.tar.gz: 21a73aaa9036e979ac02bec783621b244c02f9ded173db66356133d66d9b27a628274d99c665bff594fdd6b1e31e3765694f67d2cc163d584370117408d867e0
@@ -7,15 +7,23 @@ export default class extends Controller {
7
7
  showNext (event) {
8
8
  event.preventDefault()
9
9
 
10
- const nextTab = this.currentTab.nextElementSibling
11
- bootstrap.Tab.getOrCreateInstance(nextTab).show()
10
+ this.show(this.currentTab.nextElementSibling)
12
11
  }
13
12
 
14
13
  showPrevious (event) {
15
14
  event.preventDefault()
16
15
 
17
- const previousTab = this.currentTab.previousElementSibling
18
- bootstrap.Tab.getOrCreateInstance(previousTab).show()
16
+ this.show(this.currentTab.previousElementSibling)
17
+ }
18
+
19
+ // The clicked button is in the pane being hidden, so move focus to the shown tab and,
20
+ // if the user has scrolled past the tab list (e.g., on a short screen), scroll back to it.
21
+ show (tab) {
22
+ bootstrap.Tab.getOrCreateInstance(tab).show()
23
+ tab.focus({ preventScroll: true })
24
+
25
+ const tabList = tab.closest('[role~="tablist"]')
26
+ if (tabList.getBoundingClientRect().top < 0) tabList.scrollIntoView({ block: 'start' })
19
27
  }
20
28
 
21
29
  get currentTab () {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SdrViewComponents
4
- VERSION = '0.23.1'
4
+ VERSION = '0.23.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
4
+ version: 0.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Collier