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

Updating Index.tsx #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nativeanish
Copy link

removing the whitespace from the input data

removing the whitespace from the input data
@vercel
Copy link

vercel bot commented Feb 15, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/aabishkaryal/nepal-districts/37E9uabGp4hcfrAwAXcES3RVUxtR
✅ Preview: https://nepal-districts-git-fork-nativeanish-patch-1-aabishkaryal.vercel.app

@@ -33,7 +33,7 @@ export default function Home() {
if (inputElementRef.current?.value) {
const userInput = inputElementRef.current.value;
const districtIndex = DistrictData.findIndex(
(d) => d.name.toLowerCase() === userInput.toLowerCase()
(d) => d.name.toLowerCase() === userInput.trim().toLowerCase()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be better to trim on line 34 so that we don't trim on each iteration.

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

Successfully merging this pull request may close these issues.

None yet

2 participants