All files / packages/sds-recipes/src/modules/c/helptext helptext.js

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45                    4x   4x 4x                                                              
import { LightningElement, api } from 'lwc';
import { findElementByTagNameRecursively } from 'c/privateUtils';
 
// Needed for ariaObserver
// import AriaObserver from 'lightning/ariaObserver';
 
export default class Helptext extends LightningElement {
  // Render component in native shadow mode
  static shadowSupportMode = 'native';
 
  @api placement;
 
  _cachedControlElement;
  _cachedContentElement;
 
  // Needed for ariaObserver
  // constructor() {
  //   super();
  //   this.ariaObserver = new AriaObserver(this);
  // }
 
  handleControlSlotChange(event) {
    // Needed for ariaObserver
    // const controlRoot = event.target.assignedNodes()[0];
    // this._cachedControlElement = findElementByTagNameRecursively(controlRoot, 'button');
  }
 
  handleContentSlotChange(event) {
    // Needed for ariaObserver
    // this._cachedContentElement = event.target.assignedNodes()[0];
    // this.ariaObserver.connect({
    //   attribute: 'aria-describedby',
    //   targetNode: this._cachedControlElement,
    //   relatedNodes: this._cachedContentElement,
    // });
  }
 
  // Needed for ariaObserver
  // renderedCallback() {
  //   if (this.isConnected) {
  //     this.ariaObserver.sync();
  //   }
  // }
}