Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Mar 2019 at 18:29 UTC
Updated:
8 Apr 2019 at 21:14 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
c.e.a commentedComment #3
jrockowitz commentedI am unable to replicate this issue using the attached webform.
Comment #4
c.e.a commentedOk... The problem is generated due to the webform is being launched within a dialog.
See it in action!
Visit:
/admin/structure/webform/manage/issue_3042982_hide_the_edit_butt/settingsand try to launch the webform from the "Test Normal" button.Thank you,
Comment #5
jrockowitz commentedThis a tricky issue with a simple but confusing patch. I might need to rethink the approach.
Please test the patch.
Comment #6
c.e.a commentedPatch #5 is worked for me tested on '8.x-5.2-rc3' version.
A bit of explanation which might be useful:
1)
Results: 'Hide' button is indeed hidden from display (Expected behavior)
2)
Results: 'Hide' button is displayed (Expected behavior)... But the 'edit' button is displayed inside the dialog form and not on its edges. (Which is great)
Usually all buttons of a webform are displayed at the bottom edge of the dialog and not inside it due to how Drupal core behaves. (See the image posted in the question above)
Note:
"< Previous" button and "Submit" button are still displayed at the bottom edge of the dialog.... only the "edit" button is displayed inside the webform.
Comment #7
jrockowitz commentedThe issue is Drupal.behaviors.dialog.prepareDialogButtons grabs all buttons in .form-actions and places them at the bottom of the dialog.
Comment #8
c.e.a commentedI am aware of this issue but I was surprised because after applying the patch #5 the 'edit' button is not following this behavior (http://cgit.drupalcode.org/drupal/tree/core/misc/dialog/dialog.ajax.js?i...) (which is just great)
Comment #9
jrockowitz commentedThe attached patch is a better approach because it solves this issue in only one place and includes test coverage.
Comment #10
c.e.a commentedPatch #9 is hiding the 'edit' button as required!
Comment #12
jrockowitz commentedI committed the patch. Please download the latest dev release to review.