James when I add the legend portion of the Legend widget sample to the widgets layerlist actions sample I do not see that issue at all:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>LayerList widget with actions - 4.5</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.5/esri/css/main.css">
<script src="https://js.arcgis.com/4.5/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/GroupLayer",
"esri/layers/MapImageLayer",
"esri/widgets/LayerList",
"esri/widgets/Legend",
"dojo/domReady!"
], function(
Map, MapView, GroupLayer, MapImageLayer, LayerList, Legend
) {
var householdIncomeLayer = new MapImageLayer({
url: "https://server.arcgisonline.com/arcgis/rest/services/Demographics/USA_Median_Household_Income/MapSer...",
title: "US Median Household Income"
});
var medianNetWorthLayer = new MapImageLayer({
url: "https://server.arcgisonline.com/arcgis/rest/services/Demographics/USA_Median_Net_Worth/MapServer",
title: "US Median Net Worth",
visible: false
});
var demographicGroupLayer = new GroupLayer({
title: "US Demographics",
visible: true,
visibilityMode: "exclusive",
layers: [householdIncomeLayer, medianNetWorthLayer],
opacity: 0.75
});
var map = new Map({
basemap: "dark-gray",
layers: [demographicGroupLayer]
});
var view = new MapView({
center: [-98.5795, 39.8282],
zoom: 5,
container: "viewDiv",
map: map
});
function defineActions(event) {
var item = event.item;
if (item.title === "US Demographics") {
item.actionsSections = [
[{
title: "Go to full extent",
className: "esri-icon-zoom-out-fixed",
id: "full-extent"
}, {
title: "Layer information",
className: "esri-icon-description",
id: "information"
}],
[{
title: "Increase opacity",
className: "esri-icon-up",
id: "increase-opacity"
}, {
title: "Decrease opacity",
className: "esri-icon-down",
id: "decrease-opacity"
}]
];
}
}
view.then(function() {
var layerList = new LayerList({
view: view,
listItemCreatedFunction: defineActions
});
layerList.on("trigger-action", function(event) {
var visibleLayer = householdIncomeLayer.visible ?
householdIncomeLayer : medianNetWorthLayer;
var id = event.action.id;
if (id === "full-extent") {
view.goTo(visibleLayer.fullExtent);
} else if (id === "information") {
window.open(visibleLayer.url);
} else if (id === "increase-opacity") {
if (demographicGroupLayer.opacity < 1) {
demographicGroupLayer.opacity += 0.25;
}
} else if (id === "decrease-opacity") {
if (demographicGroupLayer.opacity > 0) {
demographicGroupLayer.opacity -= 0.25;
}
}
});
view.ui.add(layerList, "top-right");
var legend = new Legend({
view: view
});
view.ui.add(legend, "bottom-right");
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>