Skip to content

Commit

Permalink
refactor(button, scrim): ensure ref is set last so attrs/props are in…
Browse files Browse the repository at this point in the history
… sync (#8052)

**Related Issue:** N/A

## Summary

✨🧹✨
  • Loading branch information
jcfranco authored Oct 25, 2023
1 parent f7ecc6c commit d3aa0aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/calcite-components/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,14 @@ export class Button
href={childElType === "a" && this.href}
name={childElType === "button" && this.name}
onClick={this.handleClick}
ref={this.setChildEl}
rel={childElType === "a" && this.rel}
tabIndex={this.disabled || this.loading ? -1 : null}
target={childElType === "a" && this.target}
title={this.tooltipText}
type={childElType === "button" && this.type}
{...this.globalAttributes}
// eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)
ref={this.setChildEl}
>
{loaderNode}
{this.iconStart ? iconStartEl : null}
Expand Down
3 changes: 2 additions & 1 deletion packages/calcite-components/src/components/scrim/scrim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ export class Scrim implements LocalizedComponent, T9nComponent {
{loading ? (
<calcite-loader
label={messages.loading}
ref={this.storeLoaderEl}
scale={this.loaderScale}
// eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)
ref={this.storeLoaderEl}
/>
) : null}
<div class={CSS.content} hidden={!hasContent}>
Expand Down

0 comments on commit d3aa0aa

Please sign in to comment.