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

Added options: suggestOnFocus, autocomplete, isAllowSuggestOnEmptyInput #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Wwwound
Copy link

@Wwwound Wwwound commented Jul 12, 2016

No description provided.

@@ -313,7 +340,7 @@
}
});
var input = Polymer.dom(this.root).querySelector('paper-input');
input.$.input.autocomplete = 'address-level4';
input.$.input.autocomplete = this.autocomplete;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any use case you think it's necessary to assign this autocomplete value of the input?

This line of code is to fix the Chrome Autofilling problem.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without autocomplete="Off" I have suggest(browser) on
suggest(paper-typeahead-input). And browser suggest blocks
paper-typeahead-input suggesting. Maybe you know another way to resolve
this issue?
[image: Inline images 1]

On 13 July 2016 at 23:31, Tianxiang Zhang [email protected] wrote:

In paper-typeahead-input.html
#30 (comment)
:

@@ -313,7 +340,7 @@
}
});
var input = Polymer.dom(this.root).querySelector('paper-input');

  •  input.$.input.autocomplete = 'address-level4';
    
  •  input.$.input.autocomplete = this.autocomplete;
    

Do you have any use case you think it's necessary to assign this
autocomplete value of the input?

This line of code is to fix the Chrome Autofilling problem.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/cheonhyangzhang/paper-typeahead-input/pull/30/files/dfdc34b0472906d1f9c7005d4442b0162ab8c4f8#r70702583,
or mute the thread
https://github.com/notifications/unsubscribe/AG0SnOjkUkLbKRf2A1xmursYW3wXOD8nks5qVUsYgaJpZM4JKWUL
.

C уважением, Пличко Павел

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent autofilling of Chrome, autocomplete="Off" is not a reliable solution. Chrome Browser Ignoring AutoComplete=Off. See discussion here http://stackoverflow.com/questions/12374442/chrome-browser-ignoring-autocomplete-off. And plus, the expected behavior of paper-typeahead-input is to provide its own suggest, so I don't see why we need to expose this autocomplete property of inner input as the property of paper-typeahead-input.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ок, no problem.But this solution is working for me.

On 18 July 2016 at 17:13, Tianxiang Zhang [email protected] wrote:

In paper-typeahead-input.html
#30 (comment)
:

@@ -313,7 +340,7 @@
}
});
var input = Polymer.dom(this.root).querySelector('paper-input');

  •  input.$.input.autocomplete = 'address-level4';
    
  •  input.$.input.autocomplete = this.autocomplete;
    

To prevent autofilling of Chrome, autocomplete="Off" is not a reliable
solution. Chrome Browser Ignoring AutoComplete=Off. See discussion here
http://stackoverflow.com/questions/12374442/chrome-browser-ignoring-autocomplete-off.
And plus, the expected behavior of paper-typeahead-input is to provide its
own suggest, so I don't see why we need to expose this autocomplete
property of inner input as the property of paper-typeahead-input.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/cheonhyangzhang/paper-typeahead-input/pull/30/files/dfdc34b0472906d1f9c7005d4442b0162ab8c4f8#r71153857,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG0SnBPJdniRjFkkSU_AG-yL2I-8STNQks5qW4n-gaJpZM4JKWUL
.

C уважением, Пличко Павел

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do u mean you are using autocomplete="off"? because based on your current code, it's setting autocomplete="address-level4" still.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is my usage, that prevents chrome suggesting.

<paper-typeahead-input
input-value="{{_selectorValue}}"
id="query_input"
local-candidates="[[transactions]]"
placeholder="Transaction ID"
autocomplete="Off"
is-allow-suggest-on-empty-input="true"
suggest-on-focus="true"
max-suggestions="10"

On 18 July 2016 at 17:16, Tianxiang Zhang [email protected] wrote:

In paper-typeahead-input.html
#30 (comment)
:

@@ -313,7 +340,7 @@
}
});
var input = Polymer.dom(this.root).querySelector('paper-input');

  •  input.$.input.autocomplete = 'address-level4';
    
  •  input.$.input.autocomplete = this.autocomplete;
    

do u mean you are using autocomplete="off"? because based on your current
code, it's setting autocomplete="address-level4" still.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cheonhyangzhang/paper-typeahead-input/pull/30/files/dfdc34b0472906d1f9c7005d4442b0162ab8c4f8#r71154420,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG0SnMfV0Oamco4x7R5UNbHdlgCM5fYQks5qW4qzgaJpZM4JKWUL
.

C уважением, Пличко Павел

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. But if I didn't remember wrong, I have been searching for the chrome suggesting problem a lot before and the conclusion of discussions I found is that autocomplete="Off" is not reliable, workaround is to use autocomplete="address-level4". But it was quite ago, I am not sure if Chrome made some updates to change the situation here. If you like, can you search for some docs or evidence to say autocomplete="Off" is working now? Also, you change it to be "Off" is it because the original implementation using autocomplete="address-level4" is not working?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 18 July 2016 at 17:32, Tianxiang Zhang [email protected] wrote:

In paper-typeahead-input.html
#30 (comment)
:

@@ -313,7 +340,7 @@
}
});
var input = Polymer.dom(this.root).querySelector('paper-input');

  •  input.$.input.autocomplete = 'address-level4';
    
  •  input.$.input.autocomplete = this.autocomplete;
    

Got it. But if I didn't remember wrong, I have been searching for the
chrome suggesting problem a lot before and the conclusion of discussions I
found is that autocomplete="Off" is not reliable, workaround is to use
autocomplete="address-level4". But it was quite ago, I am not sure if
Chrome made some updates to change the situation here. If you like, can you
search for some docs or evidence to say autocomplete="Off" is working now?
Also, you change it to be "Off" is it because the original implementation
using autocomplete="address-level4" is not working?

I just read a lot about this issue and I understand what you meaning. I
will try to find out why Its working for me and let you know about the
result.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cheonhyangzhang/paper-typeahead-input/pull/30/files/dfdc34b0472906d1f9c7005d4442b0162ab8c4f8#r71157635,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG0SnMv-cJiCcUWVzZlFlEDwWauwEf8Fks5qW46DgaJpZM4JKWUL
.

C уважением, Пличко Павел

@cheonhyangzhang
Copy link
Owner

@Wwwound and also can you merge the latest master so that it has the fix for Travis CI build failed issue.

@@ -543,8 +574,29 @@
else{
this._suggestions = matched;
}
},
_clearSuggestings:function() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to rename it to be _clearSuggestions to be consistent with other variables used in the code. And also as the name indicated, it should only clear the suggestions, but not make the input lose focus. So maybe create another _ function to only perform lose focus and call it in e.which = 27. P.S. I tried with twitter typeahead.js when clicks on ESC the input don't lose focus. But when I try with google.com or Google drive, the input loses focus when clicks on ESC. I don't know yet what's the better behavior here.

@nicholaswmin
Copy link

So there's no way to disable the default "native" autocomplete feature of the browser on the element?

@cheonhyangzhang
Copy link
Owner

@nicholaswmin At least at the time I searched, I didn't find a native way to do it. I think it's a thing of Chrome and no elegant way to disable it.

@cheonhyangzhang
Copy link
Owner

Hi @Wwwound Haven't heard from you for a while, if you are busy with your work, do u mind I implement your pull request?

@Wwwound
Copy link
Author

Wwwound commented Aug 22, 2016

Hi. Sorry, I will implement changes soon.

On 22 August 2016 at 17:43, Tianxiang Zhang [email protected]
wrote:

Hi @Wwwound https://github.com/Wwwound Haven't heard from you for a
while, if you are busy with your work, do u mind I implement your pull
request?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG0SnLz9_2Y363XfGT0cOxW63pP-JbhQks5qibWdgaJpZM4JKWUL
.

C уважением, Пличко Павел

@cheonhyangzhang
Copy link
Owner

@Wwwound No problem just wondering how things go. No worry.

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

Successfully merging this pull request may close these issues.

3 participants