Skip to content

[WIP] Text Input#69

Open
benschinn wants to merge 6 commits intobriskml:masterfrom
benschinn:feature/text-input
Open

[WIP] Text Input#69
benschinn wants to merge 6 commits intobriskml:masterfrom
benschinn:feature/text-input

Conversation

@benschinn
Copy link
Copy Markdown

@benschinn benschinn commented Feb 17, 2019

Work In Progress.

text_input

  • Need to handle onChange
  • Need to implement placeholder

Copy link
Copy Markdown
Member

@wokalski wokalski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! I left some comments to give you pointers.

},
configureInstance: (~isFirstRender as _, {view} as node) => {
style
|> List.iter(attribute =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just FYI - this doesn't do any magic. In this case the iter does nothing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, thanks. 😅
I have so many errors being thrown regarding BriskTextInput.c, I feel like once I get that ironed out I'll have a better way of understanding and implementing the component part.

@end

NSTextInputContext *ml_BriskTextInput_make() {
BriskTextInput *input = [BriskTextInput new];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so ml_BriskTextInput_make should return a view (Like NSTextField or editable NSTextView.) NSTextInputContext is just a protocol (think java interface, functor signature (kinda)) related to text input.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So NSTextInputContext is actually a class and NSTextInputClient is a protocol. Should ml_BriskTextInput_make then return a NSTextField or NSTextView conforming to NSTextInputClient protocol?

@benschinn
Copy link
Copy Markdown
Author

@wokalski thank you for the pointers!! 🙏

@benschinn
Copy link
Copy Markdown
Author

I tried implementing NSTextInputClient, but was blocked due to my unfamiliarity with Objective-C. I was getting a huge list of errors. It was pretty overwhelming to try and get everything to compile.

I am trying a different approach. I borrowed a lot of code from BriskTextView, and made some changes and got the code to compile and render. I will continue to explore Objective-C and documentations to implement remaining features needed for basic text input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants