Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const floatingLabel = directive(() => (part: PropertyPart) => {
const lastFoundation = partToFoundationMap.get(part);
if (!lastFoundation) {
const labelElement = part.committer.element as FloatingLabel;
labelElement.classList.add('mdc-floating-label');
const adapter = createAdapter(labelElement);
const foundation = new MDCFloatingLabelFoundation(adapter);
foundation.init();
part.setValue(foundation);
partToFoundationMap.set(part, foundation);
}
});