question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to override textboxView style

See original GitHub issue

Version

  • tcomb-form-native v^0.6.3
  • react-native v0.34.1

I’m attempting to override the styles of the textboxView components in my form. Specifically using the documentation for the material design found here: https://github.com/gcanti/tcomb-form-native/blob/master/docs/STYLESHEETS.md#material-design-style-underlines

When I add the new styles for textboxView I get the following error:

Cannot read property 'normal' of undefined

Here’s the relevant code:

const t = require('tcomb-form-native');
const Form = t.form.Form;

const _ = require('lodash');
const stylesheet = _.cloneDeep(Form.stylesheet);

stylesheet.textbox.normal.borderWidth = 0;
stylesheet.textbox.error.borderWidth = 0;
stylesheet.textbox.normal.marginBottom = 0;
stylesheet.textbox.error.marginBottom = 0;

stylesheet.textboxView.normal.borderWidth = 0;
stylesheet.textboxView.error.borderWidth = 0;
stylesheet.textboxView.normal.borderRadius = 0;
stylesheet.textboxView.error.borderRadius = 0;
stylesheet.textboxView.normal.borderBottomWidth = 1;
stylesheet.textboxView.error.borderBottomWidth = 1;
stylesheet.textbox.normal.marginBottom = 5;
stylesheet.textbox.error.marginBottom = 5;

const Person = t.struct({
  email: t.String,
  username: t.String,
  password: t.String
});

const options = {
  stylesheet: stylesheet,
  auto: 'placeholders',
  fields: {
    email: {
      autoFocus: true,
      autoCapitalize: 'none'
    },
    username: {
      autoCapitalize: 'none'
    },
    password: {
      password: true,
      secureTextEntry: true
    }
  }
};

It’s only throwing an error on the textboxView lines. textbox works fine.

Any help at all would be much appreciated. Thank you!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
carly-leecommented, Jan 16, 2017

I’m having the same issue with 0.6.4.

0reactions
yfxiecommented, Mar 12, 2017

@jaredtibs @carly-lee I have the same issue. it not work after I upgraded tcomb-form-native. but I fixed the issue by yarn remove tcomb-form-native and yarn add tcomb-form-native. if you guys not use yarn, npm uninstall tcomb-form-native and npm install tcomb-form-native might help you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't override a global WPF style that is set by TargetType on ...
I've tried setting Style to {x:Null}, setting custom font sizes inline, and setting a style in the resources of this control. None take ......
Read more >
textBox padding - MSDN - Microsoft
--> On my machine, I see extra white space between the left border and contained text, i.e. text is not flush with the...
Read more >
[Solved] Inserting a text box - (View topic)
Try Insert> Frame . The frame is use for both text and graphics. HTH. OpenOffice.org v3.3, LibO v3.32 on Ubuntu 10.10 and Win7....
Read more >
In this lesson, we will learn about the View Manager.
Text Box: View Manager ... Style – Access component displays ... If a change needs to happen to the child in your rep,...
Read more >
How to remove margins in cell editors - DevExpress Support
If you decided to use CellTemplate, override this style: ... default margin on the TextBoxView element ("2,0,2,0") and we cannot remove this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found