File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export class Modal extends Component {
104104 <div class="cds--modal-container">
105105 <div class="cds--modal-header">
106106
107- <p class="cds--modal-header__label cds--type-delta" id="modal -title">${ title } </p>
107+ <p class="cds--modal-header__label cds--type-delta" id="${ id } __modal -title">${ title } </p>
108108
109109 <p class="cds--modal-header__heading cds--type-beta" id="${ id } __modal-description">${ sanitizeText (
110110 options . title
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ import type {
3434 * Base chart options common to any chart
3535 */
3636export interface BaseChartOptions {
37+ /**
38+ * Optional custom chart ID
39+ */
40+ chartId ?: string
3741 /*
3842 * aria-labels and other accessibility options
3943 */
Original file line number Diff line number Diff line change @@ -251,7 +251,15 @@ export class DOMUtils extends Service {
251251 }
252252
253253 private initializeID ( ) {
254- this . chartID = Math . floor ( ( 1 + Math . random ( ) ) * 0x1000000000000 ) . toString ( 16 )
254+ // Check if user provided a custom chartId in options
255+ const customId = this . model . getOptions ( ) . chartId
256+
257+ if ( customId ) {
258+ this . chartID = customId
259+ } else {
260+ // Generate random ID as fallback
261+ this . chartID = Math . floor ( ( 1 + Math . random ( ) ) * 0x1000000000000 ) . toString ( 16 )
262+ }
255263 }
256264
257265 addMainContainer ( ) {
You can’t perform that action at this time.
0 commit comments