Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search input clear when clicking the cancel button in Detached mode #1010

Closed
absemetov opened this issue Aug 3, 2022 · 4 comments · Fixed by #1100
Closed

Search input clear when clicking the cancel button in Detached mode #1010

absemetov opened this issue Aug 3, 2022 · 4 comments · Fixed by #1100

Comments

@absemetov
Copy link

absemetov commented Aug 3, 2022

I use autocomplete with instant search, How to set search input when panel open in detached mode?
And change placeholder to query value?

@absemetov
Copy link
Author

absemetov commented Aug 3, 2022

I solved this bug

  1. I comment code

    function setIsModalOpen(value: boolean) {
    autocomplete.value.setQuery(''), it not nessasary
    This solves another problem
    636

  2. To change placeholder document.getElementsByClassName("aa-DetachedSearchButtonPlaceholder")[0].innerHTML = state.query;

function setIsModalOpen(value) {
    requestAnimationFrame(function () {
      var prevValue = props.value.core.environment.document.body.contains(dom.value.detachedOverlay);

      if (value === prevValue) {
        return;
      }

      if (value) {
        props.value.core.environment.document.body.appendChild(dom.value.detachedOverlay);
        props.value.core.environment.document.body.classList.add('aa-Detached');
        dom.value.input.focus();
      } else {
        props.value.core.environment.document.body.removeChild(dom.value.detachedOverlay);
        props.value.core.environment.document.body.classList.remove('aa-Detached');
        // autocomplete.value.setQuery('');
        autocomplete.value.refresh();
      }
    });
  }

@vnugent
Copy link

vnugent commented Aug 31, 2022

I'm also having the same problem

@FabienMotte
Copy link
Contributor

FabienMotte commented May 4, 2023

Hello @absemetov and @vnugent,

This should be fixed starting from v1.8.3.

See issue #636 (comment) and PR #1100 for reference.

Thanks!

@absemetov
Copy link
Author

Thanks @FabienMotte !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants