React-admin: AutocompleteInput suggestion list location

Created on 5 Mar 2019  路  14Comments  路  Source: marmelab/react-admin

AutocompleteInput suggestion list location still have these bugs after installing the latest release. (2.7.3)

If the suggestion list opens upward, when you search something, the list sticks to the top as it narrows.
Also the list panel stays fixed as you scroll down/up the page.

screen shot 2019-02-06 at 10 37 58

Environment

  • React-admin version: 2.7.3
  • React version: 16.8.3
  • Browser: Chrome Version 72.0.3626.121
bug

Most helpful comment

Peek 2019-04-04 10-36

All 14 comments

What is your browser version please?

Updated my comment.

Hello, I'm facing this same situation. The AutocompleteInput's suggestions inside an ArrayInput floats away from the input. I'll insert a gif as an example:


diagnose

And here is the piece of code

<ArrayInput label="Localiza莽玫es e Diagn贸sticos" source="Pathologies">
      <SimpleFormIterator>
        <ReferenceInput label="Localiza莽茫o da Les茫o" source="WoundLocaleId" reference="lesoes" filterToQuery={val => ({ localization: val })}>
          <AutocompleteInput inputValueMatcher={() => null} optionText="localization"/>
        </ReferenceInput>
        <ReferenceInput label="Diagn贸stico" source="diagnoseId" reference="diagnosticos" filterToQuery={val => ({ description: val })}>
          <AutocompleteInput inputValueMatcher={() => null} optionText="description"/>
        </ReferenceInput>
      </SimpleFormIterator>
</ArrayInput>

Environment

  • React-admin version: 2.8.2
  • React version: 16.8.4
  • Browser:

    • Chrome Version 73.0.3683.86

    • Firefox Version 68.0a1

PS: I ensured the packages were fully updated. I cleaned the cache and removed the node_modules folder and then installed all of them

The problem comes from de Popper component inside of the AutocompleteInput. Try adding to the AutocompleteInput the options below:

<AutocompleteInput inputValueMatcher={() => null} optionText="localization" options={{ suggestionsContainerProps: { disablePortal: true, modifiers: { keepTogether: { enabled: true } } } }}/>

The disablePortal option positioned it wrong
autocompeltebuggy
:cry:
PS: tried in other views and got the same result

Did you add the modifiers as well?

Yes. Tried just like you sent, without the disablePortal option and some others also. keepTogether must be true to work properly

Can you try those config in an AutocompleteInput outside the ArrayInput and SimpleformIterator iterator to see if its a compatibility problem with the ArrayInput and SimpleformIterator? or try this modifier https://popper.js.org/popper-documentation.html#modifiers..preventOverflow.

I tried the AutoCompleteInput on a filter component also. Same result. I think the problem is related to this issue that is already fixed - https://github.com/marmelab/react-admin/issues/2259
I cloned React-Admin repo and I'll make some experiments to see if i can find the origin of this behaviour

I did the same because i had the same issue, look a this issue, the second comment https://github.com/marmelab/react-admin/issues/2370

The problem comes from the popper rendering outside its bouderies. In my case the wysiwyg i had, rendered after the autocomplete input, so the popper element was taking the initial position of the autocomplete input to render. So i tested several modifiers and the solution i sent to you was the correct for my case.

In your case, it has to be another condition, but it still comes from the popper rendering outside the bouderies.

Thanks for all the help, i'll try some other things and if i succeed fixing the problem i post it here

Peek 2019-04-04 10-36

Related to #3031

Fixed by #3683

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kopax picture kopax  路  3Comments

Kmaschta picture Kmaschta  路  3Comments

Dragomir-Ivanov picture Dragomir-Ivanov  路  3Comments

9747749366 picture 9747749366  路  3Comments

alukito picture alukito  路  3Comments