Skip to content

Commit

Permalink
Fix bug when ecore wl2 call autofill
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanseo0 committed Feb 9, 2023
1 parent 6b0a2d8 commit 5840528
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions flutter/shell/platform/tizen/channels/text_input_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class TextInputChannel {

std::string autofill_id_;

// Hints for request autofill. See availabel options:
// https://api.flutter.dev/flutter/services/AutofillHints-class.html
std::vector<std::string> autofill_hints_;
};

Expand Down
6 changes: 1 addition & 5 deletions flutter/shell/platform/tizen/tizen_autofill.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ class TizenAutofill {

void OnCommit(std::string str) { commit_callback_(str); }

void CallPopupCallback() {
popup_callback_();
// response_items_.clear();
// TODO : reponse_item_ must be cleared when popup is disappeared
}
void CallPopupCallback() { popup_callback_(); }

const std::vector<std::unique_ptr<AutofillItem>>& GetAutofillItems() {
return response_items_;
Expand Down
10 changes: 7 additions & 3 deletions flutter/shell/platform/tizen/tizen_input_method_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ class TizenInputMethodContext {
void SetOnPreeditEnd(OnPreeditEnd callback) { on_preedit_end_ = callback; }

void SetOnPopupAutofillContext(OnPopupAutofillContext callback) {
popup_autofill_context_ = callback;
on_popup_autofill_context_ = callback;
}

void PopupAutofillItems() { popup_autofill_context_(); }
void PopupAutofillItems() {
if (on_popup_autofill_context_) {
on_popup_autofill_context_();
}
}

private:
void RegisterEventCallbacks();
Expand All @@ -103,7 +107,7 @@ class TizenInputMethodContext {
OnPreeditChanged on_preedit_changed_;
OnPreeditStart on_preedit_start_;
OnPreeditEnd on_preedit_end_;
OnPopupAutofillContext popup_autofill_context_;
OnPopupAutofillContext on_popup_autofill_context_;
std::unordered_map<Ecore_IMF_Callback_Type, Ecore_IMF_Event_Cb>
event_callbacks_;
};
Expand Down

0 comments on commit 5840528

Please sign in to comment.