Replies: 1 comment
-
Yeah, I think that's a perfect example for our Logger service from Here is an example of using it similar to your scenario. import { Logger } from '@patternfly/pfe-core/controllers/logger.js';
export class RhFooter extends LitElement {
private logger = new Logger(this);
/**
* Get any `<ul>`s that are in the designated link slots
* and syncronously update each list and header if we need to.
*/
public updateAccessibility(): void {
...
// get the corresponding header that should be the previous sibling
const header = isHeader(list.previousElementSibling?.tagName ?? '') ? list.previousElementSibling : null;
if (!header) {
return this.logger.warn('This links set doesn\'t have a valid header associated with it.');
} else {
header.id ||= getRandomId('rh-footer');
list.setAttribute('aria-labelledby', header.id);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Should a component complain to the console if an expected light dom element is not slotted?
Example:
Console:
[warn] - [rh-component-link] expects an <a> in <slot name="link">
Example is purely pseudo-code, not the actual idea of the component in question just a succinct representation
Beta Was this translation helpful? Give feedback.
All reactions