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

search using search icon from /issues page seems unresponsive #1088

Closed
cch5ng opened this issue Jun 11, 2016 · 6 comments
Closed

search using search icon from /issues page seems unresponsive #1088

cch5ng opened this issue Jun 11, 2016 · 6 comments
Assignees

Comments

@cch5ng
Copy link
Contributor

cch5ng commented Jun 11, 2016

While troubleshooting one of the broken automated functional tests (authenticated search, "Search Works"), I'm seeing an unresponsive search button.
(update this is a Chrome issue only, works on Firefox); tested manually with Chrome50 and with
Chromedriver v2.22 for OS X with the intern tests

Context: this issue was discovered while adding Chrome testing support to intern.js (see issue #980)

To reproduce:

  • Click All Issues
  • Enter search terms (Search by keyword input)
  • Click the search icon (far right)
  • The list doesn't update. (if you click the Return key, the URL gets updated with additional search parameters and the list does update)

I'm not sure if this is related to issue #1023.

These are a few of the files I looked at to see what may be the cause:

for the files under /models, I couldn't easily detect what might be wrong. but it seemed like one of those triggers was getting called for the successful keyword search (using Return instead of the search button).

also I don't know if this is useful info but after a successful keyword search (clicking Return after entering terms)... I also then tried clicking the search icon even though this is not a usual use case. The result was a console error like:

jquery-1.11.2.min.js:4 GET http://localhost:5000/api/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc&q=vladvlad 404 (NOT FOUND)

although if I manually create a url like "http://localhost:5000/api/issues/search?q=vladvlad", then I seem to get the expected JSON results for the record in search. hope this helps and let me know if I should do anything else. troubleshooting search might be a little over my head at this moment.

@cch5ng
Copy link
Contributor Author

cch5ng commented Jun 11, 2016

intern.js changes
for running the automated intern test on chrome, this line was added to the intern.js environments (array) value:

{ browser: 'chrome', browser_version: '50', os : 'OS X', os_version : 'El Capitan' }

also this line was added to the returned object for intern.js:
tunnel: 'NullTunnel',

to run the chromedriver for intern tests

  • cd to the directory where chromedriver was installed
  • in terminal: chromedriver --port=4444 --url-base=wd/hub
  • run intern auth search tests from webcompat dir: node_modules/.bin/intern-runner config=tests/intern functionalSuites=tests/functional/search-auth.js user='your_user' pw='your_pwd'

reference

@miketaylr
Copy link
Member

Ah yeah, there is a difference here between Chrome and Firefox.

STR (in Chrome):

  1. go to webcompat.com/issues
  2. type "lol" in the search box
  3. click the search magnifying glass icon

Expected:
Search happens (you should get 1 result). This works in Firefox.

Actual:
Search doesn't happen in Chrome.

@miketaylr
Copy link
Member

Hm, I wonder if this is because we're using a button type=submit and Chrome is trying to actually submit a form (there doesn't seem to be a real form here, since we control this via JS). Let me see if swapping this to button type=button fixes it real quick.

@miketaylr
Copy link
Member

(nope, not it, how strange)

miketaylr pushed a commit that referenced this issue Jun 25, 2016
This is to prevent them from consuming the click event in Chrome,
which apparently doesn't bubble up to the parent <button>?
@miketaylr miketaylr self-assigned this Jun 25, 2016
miketaylr pushed a commit that referenced this issue Jun 25, 2016
This is to prevent them from consuming the click event in Chrome,
which apparently doesn't bubble up to the parent <button>?
miketaylr pushed a commit that referenced this issue Jun 30, 2016
This is to prevent them from consuming the click event in Chrome,
which apparently doesn't bubble up to the parent <button>?
@karlcow
Copy link
Member

karlcow commented Jun 30, 2016

@miketaylr

Hm, I wonder if this is because we're using a button type=submit and Chrome is trying to actually submit a form (there doesn't seem to be a real form here, since we control this via JS). Let me see if swapping this to button type=button fixes it real quick.

And with a proper form element?

@miketaylr
Copy link
Member

@karlcow nah, turns out that wasn't the right issue. Just a pointer-events thing.

(But feel free to file an issue/write a patch to add a <form> element. :))

miketaylr pushed a commit that referenced this issue Jul 5, 2016
This is to prevent them from consuming the click event in Chrome,
which apparently doesn't bubble up to the parent <button>?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants