{"action":"created","issue":{"url":"https://api.github.com/repos/bolt-design-system/bolt/issues/828","repository_url":"https://api.github.com/repos/bolt-design-system/bolt","labels_url":"https://api.github.com/repos/bolt-design-system/bolt/issues/828/labels{/name}","comments_url":"https://api.github.com/repos/bolt-design-system/bolt/issues/828/comments","events_url":"https://api.github.com/repos/bolt-design-system/bolt/issues/828/events","html_url":"https://github.com/bolt-design-system/bolt/pull/828","id":348053068,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDk0NTQ5","number":828,"title":"fix: Prevent error display when form blur is triggered by js (BDS-509)","user":{"login":"remydenton","id":677668,"node_id":"MDQ6VXNlcjY3NzY2OA==","avatar_url":"https://avatars2.githubusercontent.com/u/677668?v=4","gravatar_id":"","url":"https://api.github.com/users/remydenton","html_url":"https://github.com/remydenton","followers_url":"https://api.github.com/users/remydenton/followers","following_url":"https://api.github.com/users/remydenton/following{/other_user}","gists_url":"https://api.github.com/users/remydenton/gists{/gist_id}","starred_url":"https://api.github.com/users/remydenton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remydenton/subscriptions","organizations_url":"https://api.github.com/users/remydenton/orgs","repos_url":"https://api.github.com/users/remydenton/repos","events_url":"https://api.github.com/users/remydenton/events{/privacy}","received_events_url":"https://api.github.com/users/remydenton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-06T19:30:36Z","updated_at":"2018-08-06T19:43:34Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/bolt-design-system/bolt/pulls/828","html_url":"https://github.com/bolt-design-system/bolt/pull/828","diff_url":"https://github.com/bolt-design-system/bolt/pull/828.diff","patch_url":"https://github.com/bolt-design-system/bolt/pull/828.patch"},"body":"## Jira\r\n\r\nhttp://vjira2:8080/browse/BDS-509\r\nhttp://vjira2:8080/browse/WWWD-2345\r\n\r\n## Summary\r\n\r\nPrevent Drupal webforms javascript from triggering form field error display\r\n\r\n## Details\r\n\r\nAs summarized in my comment on http://vjira2:8080/browse/WWWD-2345, when external javascript (on the Drupal side) triggers a blur event on one of the form fields, the Bolt form javascript assumes that the user has blurred the field and proceeds to display the form validation errors.\r\n\r\nThis PR adds a check for whether the blur event was triggered by a human or another script-- only if it's a human do we proceed to display an relevant form errors.\r\n\r\n## How to test\r\nThe way I tested was by manually making applying this change to Bolt within Drupal, rebuilding the webpack javascript with fin exec npm run build:default`, then confirming that the bug described in http://vjira2:8080/browse/WWWD-2345 was resolved.\r\n\r\nI thought we'd be able to recreate it in pure Bolt by running js in the console, but I was unsuccessful.  Here's how far I got:\r\n\r\n1. Open https://bolt-design-system.com/pattern-lab/patterns/02-components-form-form-full-campaign-landing/02-components-form-form-full-campaign-landing.html\r\n2. In the console, run `document.querySelector('[placeholder=\"Enter your email address\"]').focus()`\r\nExpected behavior: focus is applied to the first field and the label is displayed\r\nActual behavior: focus doesn't appear to get applied :thinking:"},"comment":{"url":"https://api.github.com/repos/bolt-design-system/bolt/issues/comments/410829764","html_url":"https://github.com/bolt-design-system/bolt/pull/828#issuecomment-410829764","issue_url":"https://api.github.com/repos/bolt-design-system/bolt/issues/828","id":410829764,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDgyOTc2NA==","user":{"login":"bolt-bot","id":36777128,"node_id":"MDQ6VXNlcjM2Nzc3MTI4","avatar_url":"https://avatars0.githubusercontent.com/u/36777128?v=4","gravatar_id":"","url":"https://api.github.com/users/bolt-bot","html_url":"https://github.com/bolt-bot","followers_url":"https://api.github.com/users/bolt-bot/followers","following_url":"https://api.github.com/users/bolt-bot/following{/other_user}","gists_url":"https://api.github.com/users/bolt-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt-bot/subscriptions","organizations_url":"https://api.github.com/users/bolt-bot/orgs","repos_url":"https://api.github.com/users/bolt-bot/repos","events_url":"https://api.github.com/users/bolt-bot/events{/privacy}","received_events_url":"https://api.github.com/users/bolt-bot/received_events","type":"User","site_admin":false},"created_at":"2018-08-06T19:43:34Z","updated_at":"2018-08-06T19:43:34Z","author_association":"COLLABORATOR","body":"<h3>:zap: Sauce Labs Test for internet explorer Passed!</h3>\n<a href=\"https://assets.saucelabs.com/jobs/1b5a8bb2fb07408282dec3ab06ac29c3/0001screenshot.png\" target=\"_blank\">\n<img align=\"right\" width=\"50%\" src=\"https://assets.saucelabs.com/jobs/1b5a8bb2fb07408282dec3ab06ac29c3/0001screenshot.png\" alt=\"Image of internet explorer test\"></a>\n\n<details open>\n  <summary>Test Details</summary>\n  <ul>\n    <li>Browser Name: Internet explorer</li>\n    <li>Browser Version: 11</li>\n    <li>Browser Platform: WINDOWS</li>\n    <li><a href=\"https://saucelabs.com/beta/tests/1b5a8bb2fb07408282dec3ab06ac29c3/commands\" target=\"_blank\">View Test in Sauce Labs</a></li>\n  </ul>\n</details>"}}
{"actor":{"display_login":"bolt-bot"}}