Skip to content

[upload] Create slotted elements in light DOM instead of using fallback content #4281

Closed

Description

@web-padawan

Describe your motivation

We would like to make it easier for Flow users to access the content of the vaadin-upload named slots:

  • "add-button"
  • "drop-label"
  • "drop-label-icon"

This would require using the same approach as we implemented for vaadin-crud in #3106 by using SlotMixin to create initial content for all of the corresponding slots, and then propagating i18n strings to set their text content.

Describe the solution you'd like

  1. Update vaadin-upload to use SlotMixin or preferably SlotController (we should eventually only have one)
  2. Make it possible to distinguish the default elements from the custom ones to decide whether to apply i18n

Note: this is a breaking changes because moving fallback content to light DOM means removing following parts:

<vaadin-button part="upload-button" id="addButton" disabled="[[maxFilesReached]]">

<div part="drop-label-icon"></div>

Additional context

See vaadin/flow-components#3542 (comment)

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions