{"action":"created","issue":{"url":"https://api.github.com/repos/vaadin/framework/issues/6924","repository_url":"https://api.github.com/repos/vaadin/framework","labels_url":"https://api.github.com/repos/vaadin/framework/issues/6924/labels{/name}","comments_url":"https://api.github.com/repos/vaadin/framework/issues/6924/comments","events_url":"https://api.github.com/repos/vaadin/framework/issues/6924/events","html_url":"https://github.com/vaadin/framework/issues/6924","id":194779055,"number":6924,"title":"Focus of input in grid cells are stolen","user":{"login":"vaadin-bot","id":20280877,"avatar_url":"https://avatars1.githubusercontent.com/u/20280877?v=4","gravatar_id":"","url":"https://api.github.com/users/vaadin-bot","html_url":"https://github.com/vaadin-bot","followers_url":"https://api.github.com/users/vaadin-bot/followers","following_url":"https://api.github.com/users/vaadin-bot/following{/other_user}","gists_url":"https://api.github.com/users/vaadin-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/vaadin-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaadin-bot/subscriptions","organizations_url":"https://api.github.com/users/vaadin-bot/orgs","repos_url":"https://api.github.com/users/vaadin-bot/repos","events_url":"https://api.github.com/users/vaadin-bot/events{/privacy}","received_events_url":"https://api.github.com/users/vaadin-bot/received_events","type":"User","site_admin":false},"labels":[{"id":16896444,"url":"https://api.github.com/repos/vaadin/framework/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-07-01T09:43:54Z","updated_at":"2018-04-09T13:27:02Z","closed_at":"2018-04-09T13:27:02Z","author_association":"COLLABORATOR","body":"**Originally by @amahdy**\n\n___\nWhen I add a text input element into a cell by creating such element and adding it to cell's element in renderer function, that input element cannot keep its focus. Shortly after (almost instantenously) user clicks the input element, it gets stolen, probably by the row selection. The problem persists in all possible selection-modes.\n\nCopied from: https://github.com/vaadin/components/issues/31\n\nReproduction code:\n\n\n```\n    public Grid GridRendererSample() {\n\n        Grid grid = new Grid();\n        grid.setSizeFull();\n\n        grid.addColumn(\"Test\", String.class).setRenderer(new HtmlRenderer());\n\n        grid.addRow(\"<input type='text' value='test 1' />\");\n        grid.addRow(\"<input type='text' value='test 2' />\");\n        grid.addRow(\"<input type='text' value='test 3' />\");\n\n        return grid;\n    }\n```\n\n\n-*Steps**\n1. Click on any input text.\n2. Try to type anything using the keyboard.\n\nThe focus is lost but not very well seen because of the valo theme.\n\n___\n Imported from https://dev.vaadin.com/ issue #18393"},"comment":{"url":"https://api.github.com/repos/vaadin/framework/issues/comments/379751110","html_url":"https://github.com/vaadin/framework/issues/6924#issuecomment-379751110","issue_url":"https://api.github.com/repos/vaadin/framework/issues/6924","id":379751110,"user":{"login":"tsuoanttila","id":12683263,"avatar_url":"https://avatars2.githubusercontent.com/u/12683263?v=4","gravatar_id":"","url":"https://api.github.com/users/tsuoanttila","html_url":"https://github.com/tsuoanttila","followers_url":"https://api.github.com/users/tsuoanttila/followers","following_url":"https://api.github.com/users/tsuoanttila/following{/other_user}","gists_url":"https://api.github.com/users/tsuoanttila/gists{/gist_id}","starred_url":"https://api.github.com/users/tsuoanttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsuoanttila/subscriptions","organizations_url":"https://api.github.com/users/tsuoanttila/orgs","repos_url":"https://api.github.com/users/tsuoanttila/repos","events_url":"https://api.github.com/users/tsuoanttila/events{/privacy}","received_events_url":"https://api.github.com/users/tsuoanttila/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T13:27:02Z","updated_at":"2018-04-09T13:27:02Z","author_association":"CONTRIBUTOR","body":"This works as intended. If you want to have a meaningful `Widget` in a `Grid` you should write a custom `WidgetRenderer` that will make the `input` a `Widget`. Grid is instructed not to mess with `Widget`s, and the `HTMLRenderer` is intended to be used for simple things like formatting a piece of text with `<b>`.\r\n\r\nI don't really even get the use-case of the original ticket as those inputs will never tell anyone that you actually changed the value, nor will they persist when scrolling the Grid."}}
{"actor":{"display_login":"tsuoanttila"}}