Skip to content

Commit

Permalink
[BUGFIX] Rename modal's title property to modalTitle
Browse files Browse the repository at this point in the history
In #98288 the modal component was rewritten to be a lit element. The
modal title was defined by a `title` attribute. However, using this
attribute has the side effect that a tooltip is rendered wherever the
cursor is positioned.

Unfortunately, this behavior cannot get disabled in browsers. To
circumvent this issue, the attribute is now renamed to `modalTitle`.

Resolves: #98355
Related: #98288
Releases: main
Change-Id: I585bfb7c69376e8a38f85e48393625d16235b31c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75735
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
andreaskienast authored and bmack committed Sep 16, 2022
1 parent 3aa034c commit 3efb7af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Build/Sources/TypeScript/backend/modal.ts
Expand Up @@ -88,7 +88,7 @@ type PartialConfiguration = Partial<Omit<Configuration, 'buttons'> & { buttons:

@customElement('typo3-backend-modal')
export class ModalElement extends LitElement {
@property({type: String, reflect: true}) title: string = '';
@property({type: String, reflect: true}) modalTitle: string = '';
@property({type: String, reflect: true}) content: string = '';
@property({type: String, reflect: true}) type: Types = Types.default;
@property({type: String, reflect: true}) severity: SeverityEnum = SeverityEnum.notice;
Expand Down Expand Up @@ -149,7 +149,7 @@ export class ModalElement extends LitElement {
<div class="modal-dialog">
<div class="t3js-modal-content modal-content">
<div class="modal-header">
<h4 class="t3js-modal-title modal-title">${this.title}</h4>
<h4 class="t3js-modal-title modal-title">${this.modalTitle}</h4>
<button class="t3js-modal-close close" @click=${() => this.bootstrapModal.hide()}>
<span aria-hidden="true">
<typo3-backend-icon identifier="actions-close" size="small"></typo3-backend-icon>
Expand Down Expand Up @@ -217,7 +217,7 @@ export class ModalElement extends LitElement {
<iframe src="${this.content}"
name="modal_frame"
class="modal-iframe t3js-modal-iframe"
@load=${(e: Event) => this.title = (e.currentTarget as HTMLIFrameElement).contentDocument.title}
@load=${(e: Event) => this.modalTitle = (e.currentTarget as HTMLIFrameElement).contentDocument.title}
></iframe>
`;
}
Expand Down Expand Up @@ -543,7 +543,7 @@ class Modal {
currentModal.severity = configuration.severity;
currentModal.variant = configuration.style;
currentModal.size = configuration.size;
currentModal.title = configuration.title;
currentModal.modalTitle = configuration.title;
currentModal.additionalCssClasses = configuration.additionalCssClasses;
currentModal.buttons = <Array<Button>>configuration.buttons;
if (configuration.callback) {
Expand Down

0 comments on commit 3efb7af

Please sign in to comment.