{"action":"closed","issue":{"url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/206","repository_url":"https://api.github.com/repos/stefanocudini/leaflet-search","labels_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/206/comments","events_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/206/events","html_url":"https://github.com/stefanocudini/leaflet-search/issues/206","id":361802550,"node_id":"MDU6SXNzdWUzNjE4MDI1NTA=","number":206,"title":"Error in calculating the maxWidth of the search field","user":{"login":"nelsonmalo","id":33978725,"node_id":"MDQ6VXNlcjMzOTc4NzI1","avatar_url":"https://avatars2.githubusercontent.com/u/33978725?v=4","gravatar_id":"","url":"https://api.github.com/users/nelsonmalo","html_url":"https://github.com/nelsonmalo","followers_url":"https://api.github.com/users/nelsonmalo/followers","following_url":"https://api.github.com/users/nelsonmalo/following{/other_user}","gists_url":"https://api.github.com/users/nelsonmalo/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonmalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonmalo/subscriptions","organizations_url":"https://api.github.com/users/nelsonmalo/orgs","repos_url":"https://api.github.com/users/nelsonmalo/repos","events_url":"https://api.github.com/users/nelsonmalo/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonmalo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-09-19T15:25:21Z","updated_at":"2018-09-24T07:06:34Z","closed_at":"2018-09-24T07:06:34Z","author_association":"NONE","body":"Hi guys\r\n\r\nLook this image:\r\n![image](https://user-images.githubusercontent.com/33978725/45762078-7a82bb80-bc25-11e8-9d48-07057234ec57.png)\r\n\r\nThe search inputs has a very small width, because the plugin is not checking correctly the map width.\r\nThis happens when the map has the width 100%\r\n\r\n This is the current code:\r\n\r\n\t    var maxWidth;\r\n\t\tif (this._input.style.maxWidth !== this._map._container.offsetWidth) {\r\n\t\t\tmaxWidth = L.DomUtil.getStyle(this._map._container, 'width');\r\n\t\t\tmaxWidth = parseInt(maxWidth);\r\n\t\t\t // other side margin + padding + width border + width search-button + width search-cancel\r\n\t\t\tmaxWidth -= 10 + 20 + 1 + 30 + 22; \r\n\r\n\t\t\tthis._input.style.maxWidth = maxWidth.toString() + 'px';\r\n\t\t}\r\n\r\n\t\t\r\n\r\nThis is a new code:\r\n\r\n\t    var maxWidth;\r\n\t\tif (this._input.style.maxWidth !== this._map._container.offsetWidth) {\r\n\t\t\tmaxWidth = L.DomUtil.getStyle(this._map._container, 'width');\r\n                        if (maxWidth==\"100%\"){\r\n                              maxWidth =this._map._container.offsetWidth;\r\n                         }\r\n                        maxWidth = parseInt(maxWidth);\r\n\t\t\t // other side margin + padding + width border + width search-button + width search-cancel\r\n\t\t\tmaxWidth -= 10 + 20 + 1 + 30 + 22; \r\n\r\n\t\t\tthis._input.style.maxWidth = maxWidth.toString() + 'px';\r\n\t\t}\r\n\r\nIf possible make fix to this issue in the next version.\r\nThank you \t\t\r\n"}}
{"actor":{"display_login":"stefanocudini"}}