{"action":"created","issue":{"url":"https://api.github.com/repos/stripe/jquery.payment/issues/252","repository_url":"https://api.github.com/repos/stripe/jquery.payment","labels_url":"https://api.github.com/repos/stripe/jquery.payment/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/stripe/jquery.payment/issues/252/comments","events_url":"https://api.github.com/repos/stripe/jquery.payment/issues/252/events","html_url":"https://github.com/stripe/jquery.payment/issues/252","id":184857238,"number":252,"title":"Can't subscribe to all input events","user":{"login":"adamwathan","id":4323180,"avatar_url":"https://avatars.githubusercontent.com/u/4323180?v=3","gravatar_id":"","url":"https://api.github.com/users/adamwathan","html_url":"https://github.com/adamwathan","followers_url":"https://api.github.com/users/adamwathan/followers","following_url":"https://api.github.com/users/adamwathan/following{/other_user}","gists_url":"https://api.github.com/users/adamwathan/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwathan/subscriptions","organizations_url":"https://api.github.com/users/adamwathan/orgs","repos_url":"https://api.github.com/users/adamwathan/repos","events_url":"https://api.github.com/users/adamwathan/events{/privacy}","received_events_url":"https://api.github.com/users/adamwathan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-24T14:30:33Z","updated_at":"2016-10-26T14:57:16Z","closed_at":null,"body":"## Problem\r\n\r\nAdding an `'input'` listener to a field formatted as a credit card of expiry date should allow other code to observe the value of the field as it changes.\r\n\r\nThis works for cases where the library does not need to do anything special with the user input, but events are suppressed when the library needs to do special masking.\r\n\r\nFor example, when the user types \"2\" into a credit card field that already contains \"424\", no input event can be observed by outside code, which means anything watching that value still sees \"424\", when they should now see \"4242 \".\r\n\r\nThis is because in those cases, `e.preventDefault()` is being called to prevent anything else from messing with the text field's value, which makes sense, but means nothing else can know when the field's value changes in these circumstances.\r\n\r\n## Proposed solution\r\n\r\nFire a custom event for input changes so outside code can subscribe to it and be notified of the new value.\r\n\r\nIn my fork, I'm currently just firing a `payment.input` event in just the cases where the default is being prevented, and then listening to the standard `input` event, as well as `payment.input`.\r\n\r\nSince we know every time we are changing the field's value, it would be nice to fire the custom event every time the input changes (not just in the cases where the default is prevented) for consistency."},"comment":{"url":"https://api.github.com/repos/stripe/jquery.payment/issues/comments/256373427","html_url":"https://github.com/stripe/jquery.payment/issues/252#issuecomment-256373427","issue_url":"https://api.github.com/repos/stripe/jquery.payment/issues/252","id":256373427,"user":{"login":"shaunstripe","id":17118312,"avatar_url":"https://avatars.githubusercontent.com/u/17118312?v=3","gravatar_id":"","url":"https://api.github.com/users/shaunstripe","html_url":"https://github.com/shaunstripe","followers_url":"https://api.github.com/users/shaunstripe/followers","following_url":"https://api.github.com/users/shaunstripe/following{/other_user}","gists_url":"https://api.github.com/users/shaunstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/shaunstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaunstripe/subscriptions","organizations_url":"https://api.github.com/users/shaunstripe/orgs","repos_url":"https://api.github.com/users/shaunstripe/repos","events_url":"https://api.github.com/users/shaunstripe/events{/privacy}","received_events_url":"https://api.github.com/users/shaunstripe/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T14:57:15Z","updated_at":"2016-10-26T14:57:15Z","body":"Hi @adamwathan, thanks for reporting.  We can't support any changes to the input event system right now."}}
{"actor":{"display_login":"shaunstripe"}}