EasyUI Forum

General Category => EasyUI for React => Topic started by: chrwei on August 06, 2019, 02:12:37 PM



Title: TextBox and PasswordBox inputID not getting set
Post by: chrwei on August 06, 2019, 02:12:37 PM
might be specifically when inside a FormField

Code:
				<FormField name="username" label="Username:"}>
<TextBox iconCls="icon-man" inputId="username" />
</FormField>
<FormField name="password" label="Password:"}>
<PasswordBox iconCls="icon-lock" inputId="password" />
</FormField>

the resulting HTML has a generated ID, not the specified one. 

my goal is to try to get the form to play nice with LastPass specifically, and other password managers if possible.  this is one of the methods the password managers use to find what field to hook into.


Title: Re: TextBox and PasswordBox inputID not getting set
Post by: jarry on August 07, 2019, 07:05:59 PM
You can custom the form field and assign the special 'inputId' value. Please try this code.
Code:
<FormField name="name">
<div style={{display:'flex',alignItems:'center'}}>
  <Label labelAlign="right" htmlFor="username" style={{width:120,textAlign:'right'}}>Name:</Label>
  <TextBox className="f-full" iconCls="icon-man" inputId="username"></TextBox>
</div>
</FormField>


Title: Re: TextBox and PasswordBox inputID not getting set
Post by: chrwei on August 12, 2019, 12:09:01 PM
that generated the html I expect, but lastpass still doesn't find the fields  :(


Title: Re: TextBox and PasswordBox inputID not getting set
Post by: jarry on August 12, 2019, 07:05:07 PM
Use this code instead.
Code:
<FormField>
<div style={{ display: 'flex', alignItems: 'center' }}>
  <Label labelAlign="right" htmlFor="username" style={{ width: 120, textAlign: 'right' }}>Name:</Label>
  <TextBox className="f-full" iconCls="icon-man" name="name" inputId="username"></TextBox>
</div>
</FormField>


Title: Re: TextBox and PasswordBox inputID not getting set
Post by: chrwei on October 14, 2019, 09:03:51 AM
this still isn't working.  a related issue, when I assign inputId to a TextBox that's inside a FormField, the inputId I assign is not used, an autogenerated like "form-field-inputid-7" is used instead.  this may at least be part of the problem