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

AutocompleteInput text not shown on edit #1578

Closed
natrim opened this issue Feb 20, 2018 · 8 comments
Closed

AutocompleteInput text not shown on edit #1578

natrim opened this issue Feb 20, 2018 · 8 comments
Labels

Comments

@natrim
Copy link
Contributor

natrim commented Feb 20, 2018

after merging #1525 the AutocompleteInput searchText is sometimes not shown
(mostly after moving mouse to address bar and reloading page by clicking in it and pressing enter)

managed to fix it by adding componentDidMount

  componentDidMount() {
    // delay this
    window.setTimeout(() => {
      this.setSearchText(this.props);
    }, 100);
  }

but that is probably not the best solution

(edit: using aor 1.4.0 with manually merged #1525 and react 0.16.2 )

@Kmaschta
Copy link
Contributor

Thanks for reporting the issue.

Can you reproduce this issue with the beta version? (available on the next branch)
Can you provide a working example with instructions to reproduce by forking the following Codesandbox please?
https://codesandbox.io/s/q7r99p8349

This will help the debug a lot.

@natrim
Copy link
Contributor Author

natrim commented Feb 26, 2018

seems to work fine in the next

@fzaninotto fzaninotto added bug and removed bug labels Mar 19, 2018
@fzaninotto
Copy link
Member

I can't reproduce the issue on master either. Can you be more specific about the scenario to reproduce the issue? Can you create a sandbox to replicate the issue?

@natrim
Copy link
Contributor Author

natrim commented Mar 20, 2018

i use it in custom component ContactPeopleInput

ommited

when you come the form that contains this component with redirect from List it works
but when you come the page directly (by copy pasting it to another tab or reloading page) the AutoCompoleteInput text is empty even when the value is selected

@fzaninotto
Copy link
Member

The problem comes from your component, because I cant' reproduce it. You should fallback to a simple AutoCompleteInput, and readd features one by one to understand where your code broke the feature.

@natrim
Copy link
Contributor Author

natrim commented Mar 22, 2018

@fzaninotto reproduced it here https://codesandbox.io/s/82jq1j3w5l
if you go to comments > create - it should have prefilled post
when you come from list its ok, if you come directly trough url or reload, then its not prefilled
(https://82jq1j3w5l.codesandbox.io/comments/create)

it's reproducible only if you take the code from AutocompleteInput out of AOR source and put it in your application (as in example)

@fzaninotto
Copy link
Member

OK, the codesandbox shows the issue, reopening. It's only on master, though.

@fzaninotto
Copy link
Member

Moved to marmelab/admin-on-rest#4

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

No branches or pull requests

3 participants