Pressing enter in any text field opens the preview

Created on 17 November 2023, about 1 year ago
Updated 19 November 2023, about 1 year ago

Logic change proposal

Today, we are using Drupal's off-canvas dialog to serve as the container of the preview pane. We use it's interfaces for launching the pane and showing the preview. There might still be a means for controlling when the pane should launch more granularly. This bug report seems to call for more sophistication in how it decides to launch.

Initial Bug report

Problem/Motivation

Pressing enter in any text field (not text area) opens the preview.

Steps to reproduce

Press enter in any text field (not text area).

Proposed resolution

Don't.

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dieterholvoet
  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    @DieterHolvoet I'm finally out of a killer crunch of work and back to looking at these bug reports.

    I think I might need to know more about your testing steps. Allow me to offer what I'm experiencing:

    1. Created a new site with Drupal 11.x + Same Page Preview + Umami Demo installation
    2. opened a Basic Page content item (About Umami)
    3. It has a text area, I hit enter after the first paragraph. Nothing immediately happens (other than the new line)
    4. I click on something else to change the focus away from the text area,
    5. The preview opens.

    This is happening because we've chosen to use the "change of focus" action to be the decision point where Same Page Preview appears. In order to fix this I suppose we need to properly set expectations on how the preview pane works.

    Maybe:
    * Preview pane launch logic needs to be separate from preview update logic.
    * Preview pane launch logic could then be exclusively activated by the preview button.
    * Preview update logic can then be logged it the preview pane is not open.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul
  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

    I’m not talking about a text area, I mean single-line text fields. The ones without newlines. The issue you mention sounds like a separate one.

  • πŸ‡ΊπŸ‡ΈUnited States cosmicdreams Minneapolis/St. Paul

    In looking at how the logic for launching the preview is working, it's the same issue.

    The preview is opening even when it isn't open yet. It launches as soon as a "watched" field receives focus and then changes focus.

    Let's talk about what the fix could be. We could:

    1. Have the preview open by default (user preference)
    2. Open the preview only when the user clicks the preview button. Then update the preview.
    3. Any other ideas?

Production build 0.71.5 2024