capybara-lightpanda 0.19.0 → 0.19.1

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: f7f40b21e78951ba7f1434247d4685db414730460bc2b40d3ffa1fc06801bd32
4
- data.tar.gz: 295d5170fd0f09da10e1a1017b034b5017257d2ca9326271ee2a94f949e178fa
3
+ metadata.gz: a454f0dd0d53f9f791377a4e7c268d577970f101d8130c2f08244808952e9075
4
+ data.tar.gz: 9f1d2088b26a9be0d7b10e0e650dd93dd95b099378404ce62e5d7e19c4d9ede2
5
5
  SHA512:
6
- metadata.gz: 60c1891000fd8024f1183d687c89d698a4c793a940fa2c8250144e9b7a6afdbffb72e5c579737cf4edf9b16b08b951135d8199d4a67502121c29650ddfdc00d3
7
- data.tar.gz: cce0bef954fa8935fa4badaa2a355d8f20b5f676957866c8cf8da4252487a8c0316a2c4ee2b2ac4a874d60b46798c1bddde7be72f7e17c3c2163201f7728ef1c
6
+ metadata.gz: c266fe7161d1a975986effc8c4fcb775b51589a40039acb829523217ea20cb90b9569c1c75e469402782b936673feeb4392298b61350118823732fe958327b9a
7
+ data.tar.gz: 37f28c43ded7af3c81ec17aeebdccf230f7bd95870ca11febdfcf88a6f338a031b953e5e1bec496f254c861ea6e5e98a85c2041ba85eb98485fe37eb981f652f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.19.1] - 2026-11-18
4
+
5
+ ### Fixed
6
+
7
+ - **Clicking a multi-select select2 field that already holds a choice opens its dropdown.** The click landed on the selected choice, which select2 ignores, so the dropdown never opened and the next `find` of an option failed. The click now stops on the field itself. Single-select select2 and other clicks behave as before.
8
+
3
9
  ## [0.19.0] - 2026-11-17
4
10
 
5
11
  > **The default browser is now a release, not the nightly.** If you relied on the rolling nightly, set `Capybara::Lightpanda::Binary.required_version = "nightly"` or `LIGHTPANDA_VERSION=nightly`. `required_version = nil` now means "the gem's default release".
@@ -613,8 +613,13 @@ module Capybara
613
613
  // child of the .select2-container that Capybara helpers click. We
614
614
  // can't use "single visible child" as a guard — select2 keeps an
615
615
  // offscreen .select2-focusser <input> sibling that has no geometry to
616
- // distinguish, so it reads as a second visible child. The descent
617
- // never starts from an interactive element, so a normal
616
+ // distinguish, so it reads as a second visible child. That's why the
617
+ // first step always descends, but below `this` the walk stops at an
618
+ // element with several visible children: a centred pointer lands on
619
+ // that element, not inside its first child. A multi select2 holding
620
+ // a choice is the case: descending into the choice is a click
621
+ // select2 deliberately ignores, while the choices list opens it.
622
+ // The descent never starts from an interactive element, so a normal
618
623
  // button/link/input click still lands exactly on `this`.
619
624
  var INTERACTIVE = { A: 1, BUTTON: 1, INPUT: 1, SELECT: 1, TEXTAREA: 1,
620
625
  OPTION: 1, LABEL: 1, SUMMARY: 1 };
@@ -622,11 +627,14 @@ module Capybara
622
627
  while (!INTERACTIVE[hit.tagName] &&
623
628
  !hit.hasAttribute('onclick') &&
624
629
  hit.getAttribute('role') !== 'button') {
625
- var next = null, ch = hit.children;
630
+ var next = null, visible = 0, ch = hit.children;
626
631
  for (var i = 0; i < ch.length; i++) {
627
- if (!window._lightpanda || _lightpanda.isVisible(ch[i])) { next = ch[i]; break; }
632
+ if (!window._lightpanda || _lightpanda.isVisible(ch[i])) {
633
+ visible++;
634
+ if (!next) next = ch[i];
635
+ }
628
636
  }
629
- if (!next) break;
637
+ if (!next || (hit !== this && visible > 1)) break;
630
638
  hit = next;
631
639
  }
632
640
  // Real pointer clicks are a mousedown -> mouseup -> click sequence,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capybara
4
4
  module Lightpanda
5
- VERSION = "0.19.0"
5
+ VERSION = "0.19.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-lightpanda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Navid Emad
@@ -57,9 +57,9 @@ dependencies:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0.8'
60
- description: A Capybara driver for Lightpanda, the fast headless browser built in
61
- Zig. Provides a production-ready driver with XPath polyfill, reliable navigation,
62
- and cookie management — ready for real-world Rails test suites.
60
+ description: 'A Capybara driver for Lightpanda, the fast headless browser built in
61
+ Zig. Same Capybara DSL, a built-in CDP client, Turbo-aware waits, and no Chrome
62
+ to install: the gem downloads the browser it was validated against.'
63
63
  email:
64
64
  - design.navid@gmail.com
65
65
  executables: