The custom element for a view has an attribute "display-id". However, it outputs the the plugin ID, not the ID of the display. Usually the display ID is something like "custom_elements_page_1", while the plugin ID is "custom_elements_page".
Related, we have this in the MR of the parent issue:
// @todo This outputs the display plugin ID, instead of the display ID. File
// a bug and fix.
$this->assertEquals('custom_elements_block', $element->getAttribute('display-id'));
Output the display-ID instead of the plugin ID, since the plugin ID is not unique. E.g. when a view contains multiple display of the same type, the frontend would not be able to differentiate.
Let's fix this + create a change record since this is a small BC-break then.
Active
1.0
Code