Skip to content

Commit

Permalink
fix for macos and screen keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 committed Nov 4, 2024
1 parent 5dc4b8f commit dfb0cd1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,12 @@ class IssueCommentItem : public CCLayer {
);
Ref<LambdaNode> focus = LambdaNode::createToEndlessCalls(
[comment_edit_input]() {
comment_edit_input->focus();
if (comment_edit_input) {
if (!comment_edit_input->getInputNode()->m_cursor->isVisible()) {
comment_edit_input->focus();
//log::debug("focus");
}
}
}, 0.1f
);
focus->setID("focus");
Expand Down Expand Up @@ -666,7 +671,8 @@ class IssueCommentItem : public CCLayer {
ntfy->show();

auto body = json.try_get<std::string>("body").value_or(m_json["body"].as_string());
comment_edit_input->setString(CCLabelTTF::create(body.c_str(), "", 1)->getString(), 1);
auto safe_text = CCLabelBMFont::create(body.c_str(), "chatFont.fnt")->getString();
comment_edit_input->setString(safe_text, 1);
}
}
);
Expand Down

0 comments on commit dfb0cd1

Please sign in to comment.