Clicking Buttons Embedded In A List Should Not Also Fire Click Events Of The List

504
0
04-15-2021 10:31 AM
Status: Open
Labels (2)
DaveFullerton
Occasional Contributor III

I created an Experience to demonstrate:

https://experience.arcgis.com/experience/576d4e201abc4140899b51259acbb9a4

Open the Experience and follow these steps to understand the issue:

1. In the List Widget, enter 'Rezoning' as the search term (same as the provided hint).

2. Note that the list is now small enough that the user may be able to find the item they are looking for in the list without any further interaction.

3. Click on a 'More Info' button to open a link in a separate tab that shows more information about the rezoning case in ePlace.

4. In the new tab, pretend you have looked at the ePlace information as a user would. Close the tab to go back to the Experience.

5. Note that the map zooms to the extent of the feature because the Action to do so has been set in the List Widget. This is a problem because it is not apparent to the user as to why this would happen.

I can't think of any reason not to prevent the event from firing in the parent node(s) of the Button Widget. If there is one, perhaps setting.tsx should have an option to turn it on when it is needed.

I looked into this in the developer edition. I copied the button widget and added a call to stopPropagation in the onClick event handler. It seems to do the trick, but I have not done anything more than preliminary testing. Please advise if you have tested this and found problems/limitations or if there is a better way of doing it.

DaveFullerton_0-1618507847787.png

If possible, I would prefer not to maintain a separate copy of the Button Widget because it makes migrating to newer versions cumbersome. Please consider changing this in the core product for the Button Widget, Image Widget, etc.