[flow] isTextInputElement (#7075)
[flow] isTextInputElement (#7075)

Summary:

I had to cast into any because flow doesn't think that checking the lowercase version of nodeName is a valid way to refine the variable from HTMLElement to HTMLInputElement. I'm also not confident enough in changing the implementation to an instanceof HTMLInputElement to please flow. It also takes care of the null check in the process.

The `nodeName &&` condition wasn't useful since the two branches are checking it against concrete values and actually makes the type different since nodeName is not a boolean per se. I replaced them with if conditions to make it clearer what it actually did instead of doing boolean logic tricks.

It is unclear why I had to type supportedInputTypes, see this internal post for a discussion: https://www.facebook.com/groups/flowtype/permalink/1084168611631753/

The only difference in behavior is that I now explicitely convert to boolean the object dereference via `!!`.

Test Plan:
npm run flow
Careful inspection of the code

Reviewers: 663c8c2f2861ffa32b57d2756c3a277500005cdc@spicyj
chippieTV/react,VioletLife/react,terminatorheart/react,usgoodus/react,empyrical/react,pyitphyoaung/react,facebook/react,ericyang321/react,chicoxyzzy/react,brigand/react,bspaulding/react,pyitphyoaung/react,shergin/react,kaushik94/react,jontewks/react,tomocchino/react,bspaulding/react,jzmq/react,mosoft521/react,eoin/react,quip/react,pyitphyoaung/react,rickbeerendonk/react,dilidili/react,brigand/react,jzmq/react,rickbeerendonk/react,staltz/react,silvestrijonathan/react,chenglou/react,krasimir/react,cpojer/react,tomocchino/react,jontewks/react,claudiopro/react,krasimir/react,rricard/react,andrerpena/react,tomocchino/react,rohannair/react,jontewks/react,usgoodus/react,flarnie/react,jzmq/react,jquense/react,yangshun/react,anushreesubramani/react,edvinerikson/react,dilidili/react,Simek/react,flarnie/react,VioletLife/react,ArunTesco/react,krasimir/react,aaron-goshine/react,jzmq/react,kaushik94/react,theseyi/react,richiethomas/react,acdlite/react,microlv/react,apaatsio/react,chenglou/react,quip/react,staltz/react,pswai/react,theseyi/react,camsong/react,richiethomas/react,mhhegazy/react,TaaKey/react,Simek/react,flarnie/react,jdlehman/react,facebook/react,yiminghe/react,bspaulding/react,TaaKey/react,camsong/react,aickin/react,edvinerikson/react,richiethomas/react,jameszhan/react,empyrical/react,pyitphyoaung/react,tomocchino/react,silvestrijonathan/react,jordanpapaleo/react,chicoxyzzy/react,empyrical/react,AlmeroSteyn/react,AlmeroSteyn/react,camsong/react,VioletLife/react,staltz/react,roth1002/react,flarnie/react,chippieTV/react,STRML/react,jquense/react,facebook/react,cpojer/react,mjackson/react,niubaba63/react,rickbeerendonk/react,terminatorheart/react,mjackson/react,shergin/react,apaatsio/react,richiethomas/react,rickbeerendonk/react,claudiopro/react,trueadm/react,VioletLife/react,trueadm/react,maxschmeling/react,yungsters/react,Simek/react,billfeller/react,edvinerikson/react,prometheansacrifice/react,usgoodus/react,cpojer/react,mhhegazy/react,niubaba63/react,staltz/react,niubaba63/react,TheBlasfem/react,TaaKey/react,prometheansacrifice/react,chicoxyzzy/react,kaushik94/react,bspaulding/react,edvinerikson/react,jorrit/react,quip/react,claudiopro/react,jorrit/react,glenjamin/react,theseyi/react,quip/react,camsong/react,cpojer/react,facebook/react,joecritch/react,jameszhan/react,nhunzaker/react,richiethomas/react,aickin/react,wmydz1/react,billfeller/react,flarnie/react,mosoft521/react,trueadm/react,glenjamin/react,roth1002/react,pyitphyoaung/react,rohannair/react,rickbeerendonk/react,facebook/react,jdlehman/react,pswai/react,cpojer/react,anushreesubramani/react,claudiopro/react,mhhegazy/react,flipactual/react,joecritch/react,tomocchino/react,terminatorheart/react,chenglou/react,shergin/react,maxschmeling/react,jorrit/react,bspaulding/react,flipactual/react,AlmeroSteyn/react,rricard/react,jdlehman/react,usgoodus/react,microlv/react,andrerpena/react,rricard/react,maxschmeling/react,wmydz1/react,rricard/react,prometheansacrifice/react,pswai/react,sekiyaeiji/react,terminatorheart/react,eoin/react,aickin/react,yangshun/react,STRML/react,andrerpena/react,microlv/react,roth1002/react,edvinerikson/react,ArunTesco/react,trueadm/react,TaaKey/react,maxschmeling/react,pswai/react,mhhegazy/react,acdlite/react,dilidili/react,aaron-goshine/react,jorrit/react,richiethomas/react,glenjamin/react,brigand/react,prometheansacrifice/react,chicoxyzzy/react,VioletLife/react,acdlite/react,pswai/react,TheBlasfem/react,pyitphyoaung/react,jquense/react,trueadm/react,facebook/react,acdlite/react,apaatsio/react,niubaba63/react,empyrical/react,aickin/react,yiminghe/react,krasimir/react,jdlehman/react,joecritch/react,aaron-goshine/react,roth1002/react,cpojer/react,quip/react,pswai/react,rickbeerendonk/react,rohannair/react,empyrical/react,trueadm/react,aaron-goshine/react,terminatorheart/react,yungsters/react,STRML/react,chicoxyzzy/react,acdlite/react,nhunzaker/react,shergin/react,syranide/react,chippieTV/react,nhunzaker/react,brigand/react,AlmeroSteyn/react,jordanpapaleo/react,theseyi/react,nhunzaker/react,niubaba63/react,jordanpapaleo/react,jdlehman/react,TaaKey/react,STRML/react,jdlehman/react,richiethomas/react,billfeller/react,brigand/react,syranide/react,mjackson/react,apaatsio/react,krasimir/react,Simek/react,empyrical/react,VioletLife/react,rlugojr/react,bspaulding/react,aaron-goshine/react,mjackson/react,silvestrijonathan/react,jordanpapaleo/react,rickbeerendonk/react,kaushik94/react,jzmq/react,chicoxyzzy/react,mjackson/react,AlmeroSteyn/react,jameszhan/react,theseyi/react,eoin/react,bspaulding/react,andrerpena/react,edvinerikson/react,yiminghe/react,STRML/react,wmydz1/react,jontewks/react,rlugojr/react,shergin/react,jameszhan/react,TheBlasfem/react,billfeller/react,chicoxyzzy/react,kaushik94/react,leexiaosi/react,chenglou/react,STRML/react,TheBlasfem/react,ericyang321/react,jontewks/react,glenjamin/react,yungsters/react,eoin/react,STRML/react,wmydz1/react,billfeller/react,yangshun/react,jordanpapaleo/react,yungsters/react,yangshun/react,nhunzaker/react,mosoft521/react,flarnie/react,joecritch/react,roth1002/react,claudiopro/react,joecritch/react,chenglou/react,silvestrijonathan/react,anushreesubramani/react,mhhegazy/react,Simek/react,wmydz1/react,shergin/react,rlugojr/react,jorrit/react,AlmeroSteyn/react,yiminghe/react,microlv/react,empyrical/react,anushreesubramani/react,jdlehman/react,prometheansacrifice/react,rricard/react,leexiaosi/react,pyitphyoaung/react,nhunzaker/react,nhunzaker/react,jquense/react,silvestrijonathan/react,anushreesubramani/react,yungsters/react,tomocchino/react,jameszhan/react,glenjamin/react,chippieTV/react,anushreesubramani/react,billfeller/react,krasimir/react,staltz/react,jameszhan/react,acdlite/react,rlugojr/react,jordanpapaleo/react,yungsters/react,silvestrijonathan/react,claudiopro/react,aickin/react,yangshun/react,anushreesubramani/react,ericyang321/react,rlugojr/react,camsong/react,eoin/react,tomocchino/react,jorrit/react,aaron-goshine/react,VioletLife/react,kaushik94/react,niubaba63/react,terminatorheart/react,aickin/react,prometheansacrifice/react,ericyang321/react,TheBlasfem/react,Simek/react,flipactual/react,ericyang321/react,eoin/react,chenglou/react,theseyi/react,roth1002/react,silvestrijonathan/react,leexiaosi/react,sekiyaeiji/react,krasimir/react,yiminghe/react,mjackson/react,aickin/react,rohannair/react,mjackson/react,joecritch/react,kaushik94/react,cpojer/react,jzmq/react,trueadm/react,facebook/react,AlmeroSteyn/react,shergin/react,mosoft521/react,mhhegazy/react,brigand/react,andrerpena/react,yangshun/react,prometheansacrifice/react,claudiopro/react,jontewks/react,jzmq/react,microlv/react,ericyang321/react,TaaKey/react,jquense/react,chippieTV/react,jquense/react,roth1002/react,quip/react,jorrit/react,quip/react,TaaKey/react,yungsters/react,joecritch/react,edvinerikson/react,rohannair/react,mosoft521/react,usgoodus/react,maxschmeling/react,rohannair/react,brigand/react,syranide/react,wmydz1/react,TaaKey/react,acdlite/react,TaaKey/react,dilidili/react,syranide/react,wmydz1/react,maxschmeling/react,maxschmeling/react,camsong/react,yiminghe/react,rlugojr/react,TaaKey/react,yangshun/react,microlv/react,Simek/react,rricard/react,mosoft521/react,usgoodus/react,sekiyaeiji/react,andrerpena/react,dilidili/react,TaaKey/react,jordanpapaleo/react,staltz/react,camsong/react,rohannair/react,ArunTesco/react,glenjamin/react,glenjamin/react,ericyang321/react,apaatsio/react,rlugojr/react,TheBlasfem/react,mosoft521/react,niubaba63/react,flarnie/react,yiminghe/react,jameszhan/react,chippieTV/react,apaatsio/react,jquense/react,chenglou/react,dilidili/react,billfeller/react,apaatsio/react,dilidili/react,mhhegazy/react