Skip to content

Media picker: Allows cancellation of folder creation, and adds buttons for better accessibility (closes #20452) - #23276

Merged
nielslyngsoe merged 6 commits into
v17/devfrom
v17/feature/cancel-folder-creation
Jul 6, 2026
Merged

Media picker: Allows cancellation of folder creation, and adds buttons for better accessibility (closes #20452)#23276
nielslyngsoe merged 6 commits into
v17/devfrom
v17/feature/cancel-folder-creation

Conversation

@iOvergaard

Copy link
Copy Markdown
Contributor

Prerequisites

Fixes #20452

Description

Adds a key listener to presses of the ESC button to allow cancelling a folder creation.

Adds a Create button and a real <form> element surrounding the folder creation input for accessibility.

Adds an inline appended Cancel button (with an X icon) to additionally allow cancelling creation through a mouse click.

Screenshots

2026-07-02.at.15.47.44.-.Lime.Heron.mp4
image

Copilot AI review requested due to automatic review settings July 2, 2026 13:48
@iOvergaard
iOvergaard changed the base branch from main to v17/dev July 2, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves the media picker’s “create folder” flow by adding explicit cancel affordances and more accessible form semantics, aiming to address #20452 where folder creation couldn’t be abandoned without closing the picker.

Changes:

  • Add ESC handling + a cancel button to exit folder creation.
  • Wrap the new-folder input in a real <form> and add an explicit “Create” submit button for accessibility.
  • Update kitchen-sink mock media-type data to mark the “Folder” media type as a folder.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/components/media-picker-folder-path.element.ts Adds cancel/create UI and ESC handling for the inline “new folder” creation flow in the media picker.
src/Umbraco.Web.UI.Client/mocks/data/sets/kitchen-sink/media-type.data.ts Adjusts mock media type data to set the “Folder” type as isFolder: true.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/components/media-picker-folder-path.element.ts:229

  • Escape handling is only wired on the folder-name , so when the UI is in "folder type selection" mode (this._selectingFolderType === true) pressing ESC will still bubble up to the modal and close the media picker instead of cancelling folder creation. This leaves the original issue unresolved for the multi-folder-type scenario.

Consider listening for Escape on the component wrapper (and only intercepting it while selecting/typing) so it cancels both type-selection and name-entry states.

	#onKeydown(e: KeyboardEvent) {
		if (e.key === 'Escape') {
			e.preventDefault();
			e.stopImmediatePropagation();
			this.#cancelFolderCreation();
		}
	}

	override render() {
		return html`<div id="path">
			<uui-breadcrumbs>
				${repeat(

…bmit

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@iOvergaard iOvergaard changed the title Media picker: Allows cancellation of folder creation, and add buttons for better accessibility Media picker: Allows cancellation of folder creation, and add buttons for better accessibility (closes #20452) Jul 2, 2026
@iOvergaard iOvergaard changed the title Media picker: Allows cancellation of folder creation, and add buttons for better accessibility (closes #20452) Media picker: Allows cancellation of folder creation, and adds buttons for better accessibility (closes #20452) Jul 2, 2026
@nielslyngsoe

Copy link
Copy Markdown
Member

Surely an improvement, so from a UX perspective I accept the change.

But, (as always)

If you want to take it to the next level, then I would take that UI and put it into a dialog. Then it becomes a known UX format, cause this is very much a custom solution.

The problem with this type of UX is that it has limited space and a different look than everything else, so new users will spend a longer time decoding what it is about.

Where a dialog with an input, and the classis CTA's 'cancel', 'create' would be decoded instantly.

@nielslyngsoe nielslyngsoe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V17: Unable to cancel folder creation from the media picker

3 participants