hape42 / dailygammon

DailyGammon-app is free and ad-free client for the long-running DailyGammon web-based application.
https://hape42.de/RoadMap
16 stars 6 forks source link

Chat bug #47

Closed hape42 closed 1 year ago

hape42 commented 1 year ago

After I chatted, I had to press button to uncover the keyboard to reveal the button>. But then I tapped within the text box to add more text. However, my previous text disappeared. --

Smiles2go commented 1 year ago

Agree this is unpleasant. In some (not all) message compose situations, DG pre-populates pane with something like "enter message here". User taps into pane to begin composition causes keyboard to rise and the pre-set instructional text is cleared - this much is fine.

Problem is that after user has entered text, exited the compose mode, and wants to go back and edit or add message text, tapping the compose pane again clears content of the pane, as though DG assumes pane could hold only pre-set "enter message here" text.

Unfriendly to automatically delete user-entered text and to disallow useful re-entry to compose / edit mode.

hape42 commented 1 year ago

I changed from


-(BOOL)textViewShouldBeginEditing:(UITextView *)textField
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
    self.playerChat.text = @"";
    self.answerMessage.text = @"";

    return YES;
}
to:

-(BOOL)textViewShouldBeginEditing:(UITextView *)textField
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
    if([self.playerChat.text isEqualToString:@"you may chat here"])
    {
        self.playerChat.text = @"";
        self.answerMessage.text = @"";
    }

    return YES;
}

this should solve the problem. However, testing will be time-consuming.