Skip to content

Commit 23dd4fa

Browse files
keithamusAdamShwertalondahariareliacamchenry
authoredDec 3, 2024··
remove redundant code from action-bar-element (#3216)
Co-authored-by: AdamShwert <adamshwert@github.com> Co-authored-by: Alon Dahari <alondahari@github.com> Co-authored-by: Arelia Jones <2359538+arelia@users.noreply.github.com> Co-authored-by: Cam McHenry <camchenry@users.noreply.github.com> Co-authored-by: Chris Maynard <ctmayn@github.com> Co-authored-by: Cody Bodfield <cbodfield@github.com> Co-authored-by: Dusty Greif <dustin.greif@gmail.com> Co-authored-by: Jibran Garcia <jibrang@github.com> Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com> Co-authored-by: Cameron Dutro <camertron@gmail.com> Co-authored-by: Jon Rohan <rohan@github.com>
1 parent 2c0e0b9 commit 23dd4fa

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed
 

‎.changeset/weak-birds-unite.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/view-components': patch
3+
---
4+
5+
Remove redundant code for better performance.

‎app/components/primer/alpha/action_bar_element.ts

-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ class ActionBarElement extends HTMLElement {
3636
#focusZoneAbortController: AbortController | null = null
3737

3838
connectedCallback() {
39-
// Calculate the width of all the items before hiding anything
40-
for (const item of this.items) {
41-
const width = item.getBoundingClientRect().width
42-
const marginLeft = parseInt(window.getComputedStyle(item)?.marginLeft, 10)
43-
const marginRight = parseInt(window.getComputedStyle(item)?.marginRight, 10)
44-
item.setAttribute('data-offset-width', `${width + marginLeft + marginRight}`)
45-
}
46-
4739
resizeObserver.observe(this)
4840
instersectionObserver.observe(this)
4941

0 commit comments

Comments
 (0)
Please sign in to comment.