Skip to content

Commit

Permalink
Merge pull request #284 from github/smockle/untitled
Browse files Browse the repository at this point in the history
fix: Move `noTitle` conditional.
  • Loading branch information
smockle authored May 31, 2024
2 parents 534ce30 + 257f0eb commit ed0833b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/relative-time-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ export class RelativeTimeElement extends HTMLElement implements Intl.DateTimeFor
return
}
const now = Date.now()
if (!this.#customTitle && !this.noTitle) {
if (!this.#customTitle) {
newTitle = this.#getFormattedTitle(date) || ''
if (newTitle) this.setAttribute('title', newTitle)
if (newTitle && !this.noTitle) this.setAttribute('title', newTitle)
}

const duration = elapsedTime(date, this.precision, now)
Expand Down

0 comments on commit ed0833b

Please sign in to comment.