Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Aug 9, 2023
1 parent 2ae633e commit 8ddc8ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions components/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
to_owned![editable];
move |_: MouseEvent| {
editable.process_event(&EditableEvent::Click);
focus_manager.focus();
}
};

Expand All @@ -129,9 +130,7 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
icon: CursorIcon::Text,
rect {
onkeydown: onkeydown,
onclick: move |_| {
focus_manager.focus();
},
onclick: onclick,
width: "auto",
height: "auto",
direction: "both",
Expand All @@ -156,7 +155,6 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
cursor_mode: "editable",
cursor_color: "{color}",
max_lines: "{max_lines}",
onclick: onclick,
onmouseover: onmouseover,
onmousedown: onmousedown,
highlights: highlights_attr,
Expand Down
2 changes: 1 addition & 1 deletion hooks/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub trait TextEditor: Sized + Clone + Display {
}
_ => {
if let Ok(ch) = character.parse::<char>() {
if ch.is_ascii_alphanumeric() {
if !ch.is_ascii_control() {
// Adds a new character
let char_idx =
self.line_to_char(self.cursor_row()) + self.cursor_col();
Expand Down

0 comments on commit 8ddc8ce

Please sign in to comment.