Filter not working after using browser's back button in Webform listing

Created on 29 August 2024, about 1 year ago

Problem/Motivation

After searching and selecting a webform from the autocomplete input in the Webform listing page, the browser automatically redirects to the selected webform. When the user navigates back to the listing page using the browser's back button, the search input is still filled, but the result is not filtered. Additionally, clicking the Filter button does not work, causing confusion as the listing doesn't update or filter as expected.

Steps to reproduce

  • Navigate to Admin -> Structure -> Webform.
  • In the Filter Webforms section, use the input field to search for a webform name.
  • From the autocomplete suggestions, select a webform.
  • Drupal will automatically redirect to the selected webform without needing to click the filter button.
  • Click the browser's back button to return to the webform listing page.
  • Observe that the input field is still populated with the previously searched webform name.
  • Notice that the result is not filtered.
  • Click the Filter button.

Expected Result: The webform listing should be filtered based on the keyword in the input field.

Actual Result: Clicking the Filter button does nothing, and the webform listing remains unchanged.

Proposed resolution

๐Ÿ› Bug report
Status

Active

Version

6.3

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia adhershmnair Trivandrum

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

Merge Requests

Comments & Activities

  • Issue created by @adhershmnair
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia adhershmnair Trivandrum

    On selecting a webform from the autocomplete input, the form tag is having an attribute `data-drupal-form-submit-last=` which have the selected autocomplete. When clicking the back button the data attribute is still there but not doing anything. If we remove the data attribute from the form tag on back button, then the filter will work as expected.

  • It's trueโ€”it's definitely broken.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia adhershmnair Trivandrum
  • Pipeline finished with Failed
    about 1 year ago
    Total: 3900s
    #268549
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines regina.meow

    We are on a workshop today and my first contribution to Drupal community is to review the changes within the next hour.

  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines regina.meow

    I have done manual testing but I observed different result from the expected result.

    Specifications:
    simplytest.me
    Webform - 6.3.x-dev
    Drupal core 10.3.3
    Patch: https://git.drupalcode.org/project/webform/-/merge_requests/511.diff
    Install profile: Standard

    All the following steps were reproduced and observed.

    • Navigate to Admin -> Structure -> Webform.
    • In the Filter Webforms section, use the input field to search for a webform name.
    • From the autocomplete suggestions, select a webform.
    • Drupal will automatically redirect to the selected webform without needing to click the filter button.
    • Click the browser's back button to return to the webform listing page.
    • Observe that the input field is still populated with the previously searched webform name.
    • Notice that the result is not filtered.
    • Click the Filter button.

    Expected Result: The webform listing should be filtered based on the keyword in the input field.

    Actual Result: Clicking the Filter button will redirect to the webform previously selected from the autocomplete suggestions.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jrockowitz Brooklyn, NY

    I agree that the "Expected Result: The webform listing should be filtered based on the keyword in the input field.".

    I am not sure how we can reset, via JS, the filter value after the form is submitted via autocompletion.

  • Pipeline finished with Success
    9 months ago
    Total: 173s
    #372162
  • Pipeline finished with Failed
    8 months ago
    Total: 768s
    #387643
  • Pipeline finished with Failed
    7 months ago
    Total: 146s
    #429242
  • Pipeline finished with Success
    7 months ago
    Total: 953s
    #429243
  • Pipeline finished with Success
    6 months ago
    Total: 290s
    #447716
  • Pipeline finished with Success
    6 months ago
    Total: 239s
    #447719
  • Status changed to Needs work 20 days ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jrockowitz Brooklyn, NY

    jrockowitz โ†’ changed the visibility of the branch 3471061-filter-webforms-not to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jrockowitz Brooklyn, NY

    For the immediate back button issue, we need to add the .webform-remove-single-submit class to filter forms with autocompletion.

    @see https://git.drupalcode.org/project/webform/-/blob/6.3.x/js/webform.form....

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jrockowitz Brooklyn, NY

    Expected Result: The webform listing should be filtered based on the keyword in the input field.

    We can't filter the form because it was never submitted back to the server.

    Also, I don't think we can clear the input value when the user clicks back.

    The best solution is to allow them to edit or resubmit the filter with the autocompleted value.

  • Pipeline finished with Success
    20 days ago
    Total: 562s
    #583398
  • Pipeline finished with Skipped
    20 days ago
    #583538
  • Pipeline finished with Skipped
    20 days ago
    #583539
  • Pipeline finished with Skipped
    20 days ago
    #583541
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jrockowitz Brooklyn, NY
  • Pipeline finished with Success
    about 8 hours ago
    Total: 197s
    #600228
Production build 0.71.5 2024