{"action":"created","issue":{"url":"https://api.github.com/repos/processing/p5.js/issues/834","labels_url":"https://api.github.com/repos/processing/p5.js/issues/834/labels{/name}","comments_url":"https://api.github.com/repos/processing/p5.js/issues/834/comments","events_url":"https://api.github.com/repos/processing/p5.js/issues/834/events","html_url":"https://github.com/processing/p5.js/pull/834","id":97816585,"number":834,"title":"Inputs (creates createCheckbox(), createDropdown())","user":{"login":"futuremarc","id":8646752,"avatar_url":"https://avatars.githubusercontent.com/u/8646752?v=3","gravatar_id":"","url":"https://api.github.com/users/futuremarc","html_url":"https://github.com/futuremarc","followers_url":"https://api.github.com/users/futuremarc/followers","following_url":"https://api.github.com/users/futuremarc/following{/other_user}","gists_url":"https://api.github.com/users/futuremarc/gists{/gist_id}","starred_url":"https://api.github.com/users/futuremarc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuremarc/subscriptions","organizations_url":"https://api.github.com/users/futuremarc/orgs","repos_url":"https://api.github.com/users/futuremarc/repos","events_url":"https://api.github.com/users/futuremarc/events{/privacy}","received_events_url":"https://api.github.com/users/futuremarc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-28T22:39:11Z","updated_at":"2015-08-21T01:59:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/processing/p5.js/pulls/834","html_url":"https://github.com/processing/p5.js/pull/834","diff_url":"https://github.com/processing/p5.js/pull/834.diff","patch_url":"https://github.com/processing/p5.js/pull/834.patch"},"body":"This adds `createCheckbox()`, which takes a label and a `true/false`value as params if checked or not by default. `.checked()` can be called to return a `true/false` value whether the box is checked.\r\n\r\nIt also adds `createDropdown()` which supports a multiple selection menu if `true` is passed as param. `.option()` sets the name and value respectively with arguments, `selected()` with no args returns the value selected in a dropdown (or an array of values if multiple selection menu is true). If `selected()` is given an arg it can select an item based on the value, however this isn't supported for a multiple selection dropdown.\r\n\r\n\r\nI think something we need to consider is wrapping `onchange` at the p5.Element level... `mousePressed()` works fine for things like a button or a checkbox even, but when it comes to a dropdown menu it doesn't make sense b/c it fires the event before the option is selected.\r\n\r\n\r\nLet me know what you think"},"comment":{"url":"https://api.github.com/repos/processing/p5.js/issues/comments/133245512","html_url":"https://github.com/processing/p5.js/pull/834#issuecomment-133245512","issue_url":"https://api.github.com/repos/processing/p5.js/issues/834","id":133245512,"user":{"login":"shiffman","id":191758,"avatar_url":"https://avatars.githubusercontent.com/u/191758?v=3","gravatar_id":"","url":"https://api.github.com/users/shiffman","html_url":"https://github.com/shiffman","followers_url":"https://api.github.com/users/shiffman/followers","following_url":"https://api.github.com/users/shiffman/following{/other_user}","gists_url":"https://api.github.com/users/shiffman/gists{/gist_id}","starred_url":"https://api.github.com/users/shiffman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiffman/subscriptions","organizations_url":"https://api.github.com/users/shiffman/orgs","repos_url":"https://api.github.com/users/shiffman/repos","events_url":"https://api.github.com/users/shiffman/events{/privacy}","received_events_url":"https://api.github.com/users/shiffman/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T01:59:14Z","updated_at":"2015-08-21T01:59:14Z","body":"I'm using the following two examples to test:\r\n\r\n* [checkbox](https://github.com/shiffman/p5.js/blob/dom_testing/examples/addons/p5.dom/checkbox_test/sketch.js)\r\n* [dropdown](https://github.com/shiffman/p5.js/blob/dom_testing/examples/addons/p5.dom/dropdown_test/sketch.js)\r\n\r\nThe following things aren't working:\r\n\r\n1. Not getting `changed()` to trigger for checkbox or dropdown. (Perhaps I've made a mistake?)\r\n2. `value()` not working for setting or getting with checkbox.\r\n\r\nLet me know if there's something off with my examples.\r\n"}}