question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autocomplete with multiline textfield logs error

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

When having a multiline textfield inside autocomplete, it logs an error (only in non-production):

MUI: Unable to find the input element. It was resolved to [object HTMLTextAreaElement] while an HTMLInputElement was expected.
Instead, Autocomplete expects an input element.

Make sure you have customized the input component correctly. 

However aside the error log, it works as expected.

Expected behavior 🤔

Having a multiline textfield inside autocomplete, should not log an error.

Steps to reproduce 🕹

Steps:

  1. Have a multiline textfield inside renderInput of autocomplete
  2. Check console

https://codesandbox.io/s/autocomplete-textfield-multiline-error-33l8w?file=/src/App.js

Context 🔦

I need to have a autocomplete with a textfield that supports multiline. The error seems to come from this check, however I don’t really get why a Textarea is not supported.

https://github.com/mui-org/material-ui/blob/c82145cbf97de5525b1c33e80ee2c4feaf7d8c38/packages/mui-base/src/AutocompleteUnstyled/useAutocomplete.js#L528

Your environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
michaldudakcommented, Sep 1, 2022

There’s no way to remove it in dev mode. It doesn’t show up in the production build.

2reactions
iclaude3commented, Jan 17, 2022

New to open source and looking to pick up an issue. Is this one currently being worked on?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - textbox auto complete (Multi Line) - Stack Overflow
AutoCompleteSource does not work on multiline TextBox controls. Wich means you need to make it from scratch: I would make a ListBox to...
Read more >
Autocomplete - How to use the textarea element instead of the ...
The input HTML element can't display a multiline text string so dxAutocomplete can't be multiline.
Read more >
Autocomplete Widget - jQuery UI API Documentation
Any field that can receive input can be converted into an Autocomplete, namely, <input> elements, <textarea> elements, and elements with the contenteditable ...
Read more >
The Textarea element - HTML: HyperText Markup Language
The HTML element represents a multi-line plain-text editing control, ... If the autocomplete attribute is not specified on a <textarea> ...
Read more >
TextField - Shopify.dev
error ? string, An error label to present with the field. multiline? boolean, Whether the field supports multiple lines of input. autocomplete?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found