autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

fix(js): allow body scroll when detached mode responsively disabled

Open aldenquimby opened this issue 1 year ago • 2 comments

Summary

  • Fixes #1250

Result

  • See codesandbox example playground
  • I can now scroll the body in my local app after transitioning in/out of detached mode: algolia-result

Tech Notes

  • I also tried this, but it did not work, and I'm not exactly sure why:
    return () => {
      if (panelContainerElement.contains(panelElement)) {
        if (isDetached.value) {
          setIsModalOpen(false);
        } else {
          panelContainerElement.removeChild(panelElement);
        }
      }
    };

aldenquimby avatar May 10 '24 00:05 aldenquimby

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b73fddbf92ba69f6dae5291b278611b79bf86ba8:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration
@algolia/autocomplete-example-playground Issue #1250

codesandbox-ci[bot] avatar May 10 '24 00:05 codesandbox-ci[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7b113327936dee4a79b43182fc68691e162d6063:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration
@algolia/autocomplete-example-playground Issue #1250

codesandbox-ci[bot] avatar May 10 '24 00:05 codesandbox-ci[bot]

Thanks a lot for this! Have you tried adding a test for this behaviour? Otherwise this should be good to merge

Haroenv avatar May 13 '24 14:05 Haroenv

@Haroenv I just added a test that I think should work (stitched together by copying various other tests), but I am unable to get the test suite working locally. Could you either check it for me locally, or enable the CI suite to run and I can debug based on those logs? Thank you!

aldenquimby avatar May 13 '24 18:05 aldenquimby

Thanks a lot for your contribution! This is now in 1.17.1 :)

Haroenv avatar May 14 '24 10:05 Haroenv

@Haroenv awesome, thank you for the assist!

aldenquimby avatar May 14 '24 14:05 aldenquimby