Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ export class UmbMediaPickerFolderPathElement extends UmbLitElement {
this.dispatchEvent(new UmbChangeEvent());
}

#onKeypress(e: UUIInputEvent) {
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter type should be KeyboardEvent instead of UUIInputEvent. The key property is not available on UUIInputEvent, which will cause a runtime error. Change the parameter type to KeyboardEvent.

Suggested change
#onKeypress(e: UUIInputEvent) {
#onKeypress(e: KeyboardEvent) {

Copilot uses AI. Check for mistakes.
if (e.key === 'Enter') {
requestAnimationFrame(() => {
const element = this.getHostElement().shadowRoot!.querySelector('#new-folder') as UUIInputElement;
element.blur();
});
}
}

override render() {
return html`<div id="path">
${repeat(
Expand All @@ -154,8 +163,12 @@ export class UmbMediaPickerFolderPathElement extends UmbLitElement {
label="enter a name"
value="new folder name"
@blur=${this.#addFolder}
@keypress=${this.#onKeypress}
style="margin-left: var(--uui-size-2);"
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline styles should be avoided in favor of CSS classes or component styling. Consider moving this style to a CSS class or the component's styles for better maintainability.

Copilot uses AI. Check for mistakes.
auto-width></uui-input>`
: html`<uui-button label="add folder" compact @click=${this.#focusFolderInput}>+</uui-button>`}
: html`<uui-button label="add folder" compact @click=${this.#focusFolderInput}>
<uui-icon name="icon-add" style="--uui-icon-color:inherit;"></uui-icon>
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline styles should be avoided in favor of CSS classes or component styling. Consider moving this style to a CSS class or the component's styles for better maintainability.

Copilot uses AI. Check for mistakes.
</uui-button>`}
</div>`;
}

Expand Down
Loading