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

Get rid of major copy-paste of core sharedialogview's autocompleteHandler #150

Closed
PVince81 opened this issue Sep 13, 2017 · 3 comments
Closed

Comments

@PVince81
Copy link
Contributor

We need to extend the function, not copy-paste it:

var oldHandler = obj.autocompleteHandler;
obj.autocompleteHandler = function(search, response) {
    return oldHandler.call(obj, search, function() {
        // add additional entries here
        // ...
        response();
    });
}

One challenge though is that the result is already rendered, including the "No users" entry if there was no user. So one would need to override this as well.

Best would be to have another hook / callback in core that processes the results and that can be overridden. Maybe moving the autocompleteHandler's result handling code into the dialog as two methods _queryAutocompleteResults and _processAutocompleteResults, which would allow apps to hook in.

@PVince81
Copy link
Contributor Author

@pmaier1 tech debt here. If we ever make adjustments to core's autocomplete dropdown code, we'd need to copy it into this app as well as it's been copy-pasted. I can help clean this up but might need some core modifications to allow easier extensibility of the autocomplete handler.

@PVince81
Copy link
Contributor Author

... and failing to copy said changes would have instances display the "old" behavior whenever the guest app is enabled, as it overrides the whole share autocomplete results handling.

@PVince81
Copy link
Contributor Author

PVince81 commented Oct 9, 2017

improved in #149

@PVince81 PVince81 closed this as completed Oct 9, 2017
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

1 participant