Select to view content in your preferred language

CustomContent in Feature component

332
4
03-04-2025 10:39 AM
Justin_Greco
Frequent Contributor

Does the Feature component in @ArcGIS\map-components not support CustomContent yet?  I am working on migrating an app that displays custom content using the Feature widget outside of the map, however, migrating this code to components results in the custom content not appearing.  I have tested by displaying it in a popup on the map and I see the custom content there, but just not in the Feature component.  Before I dig deeper, I thought I'd see if anyone knows if this is just not supported yet.

0 Kudos
4 Replies
ReneRubalcava
Esri Frequent Contributor

Do you have a code sample, codepen, or github of what you are trying to do? Custom Content is defined on the PopupTemplate and Feature displays that info.

0 Kudos
Justin_Greco
Frequent Contributor

Hi Rene, here is a Codepen based on the sample for the Feature component.  https://codepen.io/justingreco/pen/LEYLRMd

I altered the defaultGraphic to show CustomContent displaying TEST 1 and then text content displaying TEST 2. With 4.32 TEST 1 doesn't appear but if you change it to 4.31 TEST 1 and TEST 2 appear.

 

          const defaultGraphic = {
            popupTemplate: {
              content: [new CustomContent({
                outFields: ["*"],
                creator: () => {
                  return '<h1>TEST 1</h1>';
                }
              }), 
                {type: 'text', text:"<h1>TEST 2</h1>"}]
            }
          };

 

 

4.32

Justin_Greco_0-1741295081136.png

 

4.31

Justin_Greco_1-1741295166786.png

 

 

 

 

 

0 Kudos
LaurenBoyd
Esri Contributor

Hi @Justin_Greco -

We were able to reproduce what you are experiencing with this example. We will investigate what's going on and update you soon. Thanks for reporting this!

Lauren
Justin_Greco
Frequent Contributor

@LaurenBoyd I just tested this issue with 4.33 and it is not displaying the custom content in the Feature widget.

0 Kudos