Skip to content

Commit

Permalink
fallback to ref
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanbond committed Apr 16, 2024
1 parent adcb8f7 commit a044f03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/_classes/component/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,8 @@ export default class Component extends Element {
const isString = typeof refType === 'string';

const selector = isString && refType.includes('scope')
? `:scope > [${referenceAttributeName || this._referenceAttributeName}="${ref}"]`
: `[${referenceAttributeName || this._referenceAttributeName}="${ref}"]`;
? `:scope > [${referenceAttributeName || this._referenceAttributeName || 'ref'}="${ref}"]`
: `[${referenceAttributeName || this._referenceAttributeName || 'ref'}="${ref}"]`;

if (isString && refType.startsWith('single')) {
this.refs[ref] = element.querySelector(selector);
Expand Down

0 comments on commit a044f03

Please sign in to comment.