[Material Components iOS][TextFields] MDCTextField disabled state does not work as described in the documentation

2.5k Views Asked by At

MDCTextField disabled state does not work as described in the material design documentation

I expect that the color of the disabled state should apply to the placeholder and the border. enter image description here

But as a result I see only the dotted line below the color of the disabled state. enter image description here

is it a bug, or am I doing something wrong?

@interface MyController ()

@property (nonatomic, strong) MDCTextInputControllerOutlined *textInputController;
@property (nonatomic, strong) MDCTextField *textField;

@end

@implementation MyController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.textField = [[MDCTextField alloc] initWithFrame:CGRectMake(50.f, 50.f, 220.f, 85.f)];
    [self.view addSubview:self.textField];

    self.textInputController = [[MDCTextInputControllerOutlined alloc] initWithTextInput:self.textField];
    self.textInputController.normalColor = [UIColor purpleColor];
    self.textInputController.disabledColor = [UIColor redColor];

    self.textField.enabled = NO;
    self.textField.placeholder = @"placeholder";
    self.textField.text = @"text";
}
1

There are 1 best solutions below

1
On BEST ANSWER

Thanks for use MDC-iOS. I can confirm this is a bug. Please create a ticket on github. It will be triaged. You can follow the issue from there or even submit a PR to correct a part of it!