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

QMultilineElement failing to refresh after text entry (fix suggested) #704

Open
jhntr opened this issue Jan 7, 2015 · 1 comment
Open

Comments

@jhntr
Copy link

jhntr commented Jan 7, 2015

Hi Eduardo,
Sorry I'm not yet hip enough with Github to setup a pull request for this, and thanks so much for the outstanding library.

I've only used QuickDialog on iOS 8, so I'm not sure if this issue is present in earlier versions (or more importantly, if my proposed fix would cause issues on earlier OSs).

When using QMultilineElement, text entry works as expected, but the QMultilineElement cell does not redraw until scrolled off- and back on-screen. In my app, which uses a placeholder value, this results in the placeholder remaining in the cell even after text has been entered.

Suggested fix (on IOS 8, at least):
In QMultilineElement.m,

In the implementation of

  • (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogController *)controller indexPath:(NSIndexPath *)indexPath

The current setting for the textController.willDisappearCallback looks like this:
textController.willDisappearCallback = ^ {
weakSelf.textValue = weakTextController.textView.text;
[[tableView cellForElement:weakSelf] setNeedsDisplay];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
};

...which looks like you're trying to avoid exactly the problem I'm seeing. After some experimentation, I think the problem is the call to deselectRowAtIndexPath. The following setting for the willDisappearCallback works as expected on iOS 8:

textController.willDisappearCallback = ^ {
weakSelf.textValue = weakTextController.textView.text;
};

i.e. the cell refreshes correctly without the call to setNeedsDisplay. My suspicion is that you added this on an earlier OS version that requires it, though.

Thanks again for your work on this project!

-Jared

@nithinreddy
Copy link

This helped me, thanks Jared! :)

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

No branches or pull requests

2 participants