Skip to content

Commit 2acc633

Browse files
Adding support for several new buttons in testing page
1 parent a22debe commit 2acc633

File tree

1 file changed

+5
-4
lines changed
  • core/src/components/segment-view/test/basic

1 file changed

+5
-4
lines changed

core/src/components/segment-view/test/basic/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,25 @@
166166
const segmentView = document.querySelector('ion-segment-view');
167167

168168
const newButton = document.createElement('ion-segment-button');
169-
newButton.setAttribute('content-id', 'new');
170-
newButton.setAttribute('value', 'new');
169+
const newId = `new-${Date.now()}`;
170+
newButton.setAttribute('content-id', newId);
171+
newButton.setAttribute('value', newId);
171172
newButton.innerHTML = '<ion-label>New Button</ion-label>';
172173

173174
segment.appendChild(newButton);
174175

175176
setTimeout(() => {
176177
// Timeout to test waitForSegmentContent() in segment-button
177178
const newContent = document.createElement('ion-segment-content');
178-
newContent.setAttribute('id', 'new');
179+
newContent.setAttribute('id', newId);
179180
newContent.innerHTML = 'New Content';
180181

181182
segmentView.appendChild(newContent);
182183

183184
// Necessary timeout to ensure the value is set after the content is added.
184185
// Otherwise, the transition is unsuccessful and the content is not shown.
185186
setTimeout(() => {
186-
segment.setAttribute('value', 'new');
187+
segment.setAttribute('value', newId);
187188
}, 200);
188189
}, 200);
189190
}

0 commit comments

Comments
 (0)