MCPcopy
hub / github.com/ionic-team/ionic-framework / getSegmentView

Method getSegmentView

core/src/components/segment/segment.tsx:369–377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367 }
368
369 private getSegmentView() {
370 const buttons = this.getButtons();
371 // Get the first button with a contentId
372 const firstContentId = buttons.find((button: HTMLIonSegmentButtonElement) => button.contentId);
373 // Get the segment content with an id matching the button's contentId
374 const segmentContent = document.querySelector(`ion-segment-content[id="${firstContentId?.contentId}"]`);
375 // Return the segment view for that matching segment content
376 return segmentContent?.closest('ion-segment-view');
377 }
378
379 @Listen('ionSegmentViewScroll', { target: 'body' })
380 handleSegmentViewScroll(ev: CustomEvent<SegmentViewScrollEvent>) {

Callers 2

connectedCallbackMethod · 0.95
componentDidLoadMethod · 0.95

Calls 1

getButtonsMethod · 0.95

Tested by

no test coverage detected