Rishabh-malhotraa / caucus

Realtime Collaborate Editor with Embedded Compiler
https://caucus.rishabhmalhotra.in/
MIT License
295 stars 70 forks source link

Bind onEnter event for guest-name text field #62

Closed pavankalyan-codes closed 2 years ago

pavankalyan-codes commented 2 years ago

closes 52

pavankalyan-codes commented 2 years ago

This is an anti-pattern in react! It is not recommended todo dom-manipulation with document.___ in react. Any time you have to manipulate a node, we do it using refs; that's the react way.

Here we already have a function defined isGuestNameClick(e) when we press the button. Why don't you call that function on Keydown? You need to add some more types to the function definition to stop typescript from giving you errors.

Thanks for the comments. made changes according to it. Pls review them and merge if everything looks fine.

Rishabh-malhotraa commented 2 years ago

Thanks LGTM! 🎉

Rishabh-malhotraa commented 2 years ago

@all-contributors please add @pavankalyan-codes for code

allcontributors[bot] commented 2 years ago

@Rishabh-malhotraa

I've put up a pull request to add @pavankalyan-codes! :tada: