Skip to content

Live preview button does not trigger when you close preview #4979

@DONEILL-emp

Description

@DONEILL-emp

Description of the problem
When you edit an entry and click the live preview button the preview loads fine, if you close the preview and try to click on the preview button again nothing happens. This is because a style attribute has been added (not sure what sets this, possibly something do with the handleDrag function) but you end up with style="pointer-events: none;" on the button.

How To Reproduce

  1. View an entry with live preview enabled
  2. Inspect the live preview button, observe that no style attribute is set
  3. Click on the button
  4. Close the live preview
  5. Try to click on the button with out refreshing the page
  6. Inspect the button and observe the style attribute added

Environment Details:

  • Version: 7.5.14
  • PHP Version 8.2
  • MySQL Version 8
  • OS: Linux
  • Web Server: nginx

Possible Solution
On line 261 of https://github.com/ExpressionEngine/ExpressionEngine/blob/7.dev/themes/ee/asset/javascript/src/cp/publish/publish.js I have updated that line to remove the style attribute $('button[rel="live-preview"]').removeAttr('style').show();. But it would be better to understand what sets this in the first place and prevent it if it is not necessary.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions