Skip to content

Commit ccc28ab

Browse files
fix: component id 0 not being de-selected (#128)
* fix: component id 0 not being de-selected * fix: start component counter at 1 * remove: id === 0 check * fix: take 1 from id on window vars * fix: take 1 from id on window vars
1 parent 4ca1579 commit ccc28ab

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/shell-chrome/src/backend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getComponentName, isSerializable, serializeHTMLElement, set, waitForAlp
22

33
window.__alpineDevtool = {
44
components: [],
5-
uuid: 0,
5+
uuid: 1,
66
stopMutationObserver: false,
77
hoverElement: null,
88
observer: null,
@@ -140,7 +140,7 @@ function discoverComponents() {
140140

141141
if (!rootEl.__alpineDevtool.id) {
142142
rootEl.__alpineDevtool.id = window.__alpineDevtool.uuid++
143-
window[`$x${rootEl.__alpineDevtool.id}`] = rootEl.__x
143+
window[`$x${rootEl.__alpineDevtool.id - 1}`] = rootEl.__x
144144
}
145145

146146
var depth = 0

packages/shell-chrome/views/_partials/component.edge

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<div
1919
data-testid="console-global"
2020
class="text-white pl-2 text-xs"
21-
:title="`Available as $x${component.id} in the console`"
21+
:title="`Available as $x${component.id - 1} in the console`"
2222
>
23-
= <span x-text="`$x${component.id}`"></span>
23+
= <span x-text="`$x${component.id - 1}`"></span>
2424
</div>
2525
</h5>
2626
</a>

0 commit comments

Comments
 (0)