Skip to content

Commit afdcbe1

Browse files
authored
Merge pull request #304 from Insality/fix_input
Fix input issues
2 parents 0504496 + 326ce8b commit afdcbe1

File tree

14 files changed

+40
-1166
lines changed

14 files changed

+40
-1166
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ In this example you can inspect a variety of **Druid** components and see how th
2121

2222
To integrate the **Druid** extension into your own project, add this project as a [dependency](https://www.defold.com/manuals/libraries/) in your **Defold** game. Open your `game.project` file and add the following line to the dependencies field under the project section:
2323

24-
**Druid v1.0**
24+
**Druid v1.0.1**
2525

26-
> [https://github.com/Insality/druid/archive/refs/tags/1.0.zip](https://github.com/Insality/druid/archive/refs/tags/1.0.zip)
26+
> [https://github.com/Insality/druid/archive/refs/tags/1.0.1.zip](https://github.com/Insality/druid/archive/refs/tags/1.0.1.zip)
2727
2828
Here is a list of [all releases](https://github.com/Insality/druid/releases).
2929

@@ -222,4 +222,4 @@ For a complete history of the development of **Druid**, please check the [change
222222

223223
Your donation helps me stay engaged in creating valuable projects for **Defold**. If you appreciate what I'm doing, please consider supporting me!
224224

225-
[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/insality)
225+
[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/insality)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"content":[{"name":"game.projectc","size":4455,"pieces":[{"name":"game0.projectc","offset":0}]},{"name":"game.arci","size":12368,"pieces":[{"name":"game0.arci","offset":0}]},{"name":"game.arcd","size":3557068,"pieces":[{"name":"game0.arcd","offset":0},{"name":"game1.arcd","offset":2097152}]},{"name":"game.dmanifest","size":13892,"pieces":[{"name":"game0.dmanifest","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game0.public.der","offset":0}]}],"total_size":3587945}
1+
{"content":[{"name":"game.projectc","size":4457,"pieces":[{"name":"game0.projectc","offset":0}]},{"name":"game.arci","size":12368,"pieces":[{"name":"game0.arci","offset":0}]},{"name":"game.arcd","size":3557312,"pieces":[{"name":"game0.arcd","offset":0},{"name":"game1.arcd","offset":2097152}]},{"name":"game.dmanifest","size":13892,"pieces":[{"name":"game0.dmanifest","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game0.public.der","offset":0}]}],"total_size":3588191}

docs/druid/archive/game0.arcd

0 Bytes
Binary file not shown.

docs/druid/archive/game0.arci

0 Bytes
Binary file not shown.

docs/druid/archive/game0.dmanifest

0 Bytes
Binary file not shown.

docs/druid/archive/game0.projectc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
title = druid
3-
version = 1.0
3+
version = 1.0.1
44
write_log = 0
55
compress_archive = 1
66
publisher = Insality
77
developer = Maksim Tuprikov
88
custom_resources = /example/locales
9-
commit_sha = d2b617a14f3dbf97c050607e5dc8506ffb935f35
9+
commit_sha = be1a3d37887787185992c88df8bb28c4ed52eb3f
1010
title_as_file_name = druid
1111

1212
[display]
@@ -129,7 +129,7 @@ default_language = en
129129
localizations = en
130130

131131
[android]
132-
version_code = 926
132+
version_code = 929
133133
minimum_sdk_version = 19
134134
target_sdk_version = 34
135135
package = com.insality.druid

docs/druid/archive/game1.arcd

244 Bytes
Binary file not shown.

docs/druid/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="apple-mobile-web-app-capable" content="yes">
88
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
99

10-
<title>druid 1.0</title>
10+
<title>druid 1.0.1</title>
1111
<style type='text/css'>
1212
/* Disable user selection to avoid strange bug in Chrome on Windows:
1313
* Selecting a text outside the canvas, then clicking+draging would

docs_md/changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,4 +587,10 @@ Thoughts, wrong decisions, future plans, and how to update correctly:
587587
- Non-explicit event parameters can cause confusion, particularly with `self` parameters.
588588
- There is room for performance optimization. Memory usage is not optimized, though it can still handle heavy-load GUIs like Panthera.
589589
- Creating custom components could be made easier.
590-
- There can be a much less code bindings between elements. Like bind_grid, update_size after some changes etc.
590+
- There can be a much less code bindings between elements. Like bind_grid, update_size after some changes etc.
591+
592+
---
593+
594+
**Druid v1.0.1**
595+
596+
- **[Input]** Fixed issues with input component on Mobile devices.

druid/extended/input.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function Input.on_input(self, action_id, action)
240240
if self.max_length then
241241
self.marked_value = utf8.sub(self.marked_value, 1, self.max_length)
242242
end
243-
is_marked_text_changed = true
243+
is_marked_text_changed = self.marked_value ~= ""
244244
end
245245

246246
if action_id == const.ACTION_BACKSPACE and (action.pressed or action.repeated) then
@@ -280,7 +280,7 @@ function Input.on_input(self, action_id, action)
280280
end
281281

282282
if input_text or is_marked_text_changed then
283-
self:set_text(input_text)
283+
self:set_text(input_text or self.value)
284284

285285
if cursor_shift_indexes then
286286
self:select_cursor(self.cursor_index + cursor_shift_indexes)
@@ -304,11 +304,6 @@ function Input.on_focus_lost(self)
304304
end
305305

306306

307-
function Input.on_input_interrupt(self)
308-
--self:unselect()
309-
end
310-
311-
312307
function Input.get_text_selected(self)
313308
if self.start_index == self.end_index then
314309
return self.value

0 commit comments

Comments
 (0)