Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some type not work with alpha.10 version #90

Closed
zhaochy1990 opened this issue Sep 1, 2017 · 3 comments
Closed

some type not work with alpha.10 version #90

zhaochy1990 opened this issue Sep 1, 2017 · 3 comments

Comments

@zhaochy1990
Copy link

hi, guys
some types such as text, textarea not work under the newest version.
the 0.2.0-alpha.9 is ok, but 0.2.0-alpha.10 will not work as expected.
try and change the version in config.js
https://embed.plnkr.co/GfGHaUdbPWyg7xBmN4vg/

P.S. something might help
I reviewed your code, it seems the problem is the newest version refactored file input-base.ts, the constructor get state through InlineEditorService's getState() method, getState() returns cloned state which have property value of null, so the showText() method of input-base.ts would always render this.state.getState().value of value null

// InputBase constructor
this.state = this.service.getState().clone();
this.value = this.state.getState().value;

// InlineEditorService --> get state async
constructor(
    public events: Events,
    public config?: InlineConfig,
) {
        this.subscriptions.onUpdateStateSubscription = this.onUpdateStateOfService.subscribe(
            (state: InlineEditorState) => this.state = state,
        );
}
// the getState() method of InlineEditorService
public getState(): InlineEditorState {
    return this.state.clone();
}

// InputBase method
public showText(): string {
    return this.state.isEmpty() ? this.config.empty : this.state.getState().value;
}
@tonivj5
Copy link
Collaborator

tonivj5 commented Sep 3, 2017

Hi @zhaochy1990, thanks for your interest and help 😃

This issue is related to #79 (comment)

It's produced because I changed the changeDetectionStrategy of the component to OnPush and something isn't working properly 😢

I hope to have time next weekend. If you want to try to resolve it, I would be disposed to help you (it would be awesome 😄)

@zhaochy1990
Copy link
Author

yeah, I'd love to contribute. I will try this weekend

@tonivj5
Copy link
Collaborator

tonivj5 commented Sep 11, 2017

I have fixed it in latest version 0.2.0-alpha.11.

@zhaochy1990 thanks for your hints, they were so useful! 😄 and if you could test it 👍

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

No branches or pull requests

2 participants