ui-material-components
ui-material-components copied to clipboard
show error textfield
Make sure to check the demo app(s) for sample usage
Make sure to check the existing issues in this repository
If the demo apps cannot help and there is no issue for your problem, tell us about it
Please, ensure your title is less than 63 characters long and starts with a capital letter.
Which platform(s) does your issue occur on?
- iOS/Android/Both Both
- iOS/Android versions 7.1.1/7.0.1
- emulator or device. What type of device? emulator and device iOS
Please, provide the following version numbers that your issue occurs with:
- CLI: (run
tns --version
to fetch it) 7.1.2 - Cross-platform modules: (check the 'version' attribute in the
node_modules/@nativescript/core/package.json
file in your project) 7.1.0 - Runtime(s): (look for the
"tns-android"
and"tns-ios"
properties in thepackage.json
file of your project) - Plugin(s): (look for the version numbers in the
package.json
file of your project and paste your dependencies and devDependencies here)
I am using the textfield plugin you have created. I want to show the, in android it works by accessing the native view, but in ios I cannot access. android work fine.
`showErrorInput(txtfield: TextField, msj: string, isError:boolean){ if (isAndroid) { const txtfieldAndroid: com.google.android.material.textfield.TextInputLayout = <com.google.android.material.textfield.TextInputLayout>txtfield.android; txtfieldAndroid.setErrorEnabled(isError); txtfieldAndroid.setError(msj); }else if(isIOS){ // PropType,TextFieldProperties,initTextInputEditText
}
}`
@MariaC15 use the error
property instead it will work on both platforms.
@farfromrefug When I try to access using MDCTextInputControllerFilled it gives me an error. Cannot find the module. I have uninstalled / installed the plugin but it doesn't work. Installed the types and it doesn't work either. Removing the platforms and neither.
@MariaC15 dont try to do it natively. simply set the "error" property on your TextField
view.
@MariaC15 <MDTextField :error="myError" />
this is for Vue
@farfromrefug It is possible to do it from angular ts using txtfield.setProperty ("error", "error")?
@MariaC15 dont know about angular but you need to do it the same way you set any other property.
@farfromrefug Ok thanks for your help. It is possible add endiron?
@farfromrefug add <MDTextField :error="myError" /> When I add a variable to the error this happens
@MariaC15 this is how it is supposed to work. Following material design
@MariaC15 I have the same error.
When using
<MDTextField :error="error" />
with
data: () => ({
error: 'Email is required'
})
I have this:
When using
<MDTextField error="error" />
I have this:
@MariaC15 seems like a timing issue. Always use the first one for now
@farfromrefug I want to use the first proposition, but the rendering is not the same as for the second. Because the message should appear under the textfield (as it is for the second proposition)
@farfromrefug, @MariaC15 I found a solution by setting the helper
attribute to ' '
<MDTextField :error="error" helper=" " />
with
data: () => ({
error: 'Email is required'
})