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

Fix responsive highlight width #26973

Merged
merged 1 commit into from
Jul 29, 2018
Merged

Fix responsive highlight width #26973

merged 1 commit into from
Jul 29, 2018

Conversation

MartijnCuppens
Copy link
Member

Closes #26972

@mdo
Copy link
Member

mdo commented Jul 29, 2018

Ah, this had been bugging me for awhile and I never actually dug in.

@mdo mdo merged commit 774724a into twbs:v4-dev Jul 29, 2018
@mdo mdo mentioned this pull request Jul 29, 2018
@MartijnCuppens MartijnCuppens deleted the patch-2 branch July 30, 2018 06:36
@MartijnCuppens
Copy link
Member Author

The DOM of the autocomplete gets removed every time the search field loses focus. This made it a bit harder to debug this. I made this function which stores the autocomplete content in a variable and adds it back to the DOM if the autocomplete is cleared:

function debugSearch(){
  var target = document.querySelector('.ds-dataset-1');
  var observer = new MutationObserver(function(mutations) {
    if (target.innerHTML !== ''){
      window.serachHtml = target.innerHTML;
    }
    else {
      target.innerHTML = window.serachHtml;
      target.parentNode.style.display = 'block';
    }
  });
  observer.observe(target, {childList: true});
}

This might come in handy next time if you want to debug the search autocomplete (There are probably better solutions, but this did the trick for me)

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

Successfully merging this pull request may close these issues.

3 participants