Make the modal confirmation alert work properly with auto-generated layouts.