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.InputGroup does not respect InputLeftElement

See original GitHub issue
import {
	InputGroup,
	InputLeftElement,
	InputRightElement,
	Icon,
} from '@chakra-ui/react';
import {
	AutoComplete,
	AutoCompleteInput,
	AutoCompleteItem,
	AutoCompleteList,
	AutoCompleteGroup,
	AutoCompleteFixedItem,
  } from '@choc-ui/chakra-autocomplete';
  import { SearchIcon, ChevronRightIcon, ChevronDownIcon } from '@chakra-ui/icons';

const SearchBar = props => {
	const options = ['apple', 'appoint', 'zap', 'cap', 'japan'];
  
	return (
		<AutoComplete rollNavigation>
			{({ isOpen }) => (
				<>
					<InputGroup>
						<InputLeftElement
							pointerEvents="none"
							children={<SearchIcon />}
						/>
						<AutoCompleteInput
							variant="filled"
							placeholder="    Search..."
						/>
						<InputRightElement
							pointerEvents="none"
							children={
								<Icon as={isOpen ? ChevronRightIcon : ChevronDownIcon} />
							}
						/>
					</InputGroup>
					<AutoCompleteList>
						{options.map((option, oid) => (
							<AutoCompleteItem
								key={`optio-${oid}`}
								value={option}
								textTransform="capitalize"
								align="center"
							>
								{option}
							</AutoCompleteItem>
						))}
					</AutoCompleteList>
				</>
			)}
		</AutoComplete>
	);
};

export default SearchBar;

Result is image

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
karimcambridgecommented, Jul 1, 2021

Hi, honestly after playing around and switching things up a bit it actually seems like the issue is the Input component from chakra itself, I switched to that.

Also, check out the screenshots, look at how the icon overlaps with the placeholder / cursor.

Hi could you create a codesandbox reporoduction?

0reactions
karimcambridgecommented, Jul 11, 2021

I just found out the package is breaking with the latest Chakra version. The list is jumping off the page😔

Yea that is happening, I tried to report it. https://github.com/chakra-ui/chakra-ui/issues/4329

If you can help bring it to their attention, it needs to be fixed asap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

InputLeftElement misalignment when <Input/> size different ...
Description InputLeftElement misalignment when size different from "md" Link ... AutoComplete.InputGroup does not respect InputLeftElement ...
Read more >
Bootstrap CSS input group not working expected with Angular ...
You are trying to combine bootstrap style with material by using md-input-container and mdInput inside it. If you keep the input div pure ......
Read more >
Disabling Safari AutoFill for a single line address input
How AutoFill should be respected. This problem exists in all browsers. Currently, no browser AutoFill can neatly concatenate multiple address pieces into a ......
Read more >
EDGE bug: autocomplete="off" still displays previously ...
EDGE bug - when autocomplete is set to off, information that has been entered is not displayed. edge recently stopped following this rule, ......
Read more >
Style and appearance in Blazor AutoComplete Component
.e-outline.e-input-group.e-input-focus:hover:not(.e-success):not(.e-warning) ... You can add the search icon to the AutoComplete component by overriding the ...
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