@@ -3,6 +3,8 @@ use crate::ScrollView;
33use dioxus:: prelude:: * ;
44use freya_elements:: elements as dioxus_elements;
55use freya_elements:: events:: { KeyboardData , MouseEvent } ;
6+ use freya_hooks:: ButtonTheme ;
7+ use freya_hooks:: FontTheme ;
68use freya_hooks:: {
79 use_editable, use_focus, use_get_theme, EditableConfig , EditableEvent , EditableMode , TextEditor ,
810} ;
@@ -66,20 +68,18 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
6668 let focus_manager = use_focus ( cx) ;
6769
6870 let text = & cx. props . value ;
69- let button_theme = & theme. button ;
7071 let cursor_attr = editable. cursor_attr ( cx) ;
7172 let highlights_attr = editable. highlights_attr ( cx, 0 ) ;
7273 let width = & cx. props . width ;
7374 let height = & cx. props . height ;
7475 let max_lines = & cx. props . max_lines ;
7576
76- use_effect ( cx, & ( cx. props . value . to_string ( ) , ) , {
77+ use_memo ( cx, & ( cx. props . value . to_string ( ) , ) , {
7778 to_owned ! [ editable] ;
7879 move |( text, ) | {
7980 editable. editor ( ) . with_mut ( |editor| {
8081 editor. set ( & text) ;
8182 } ) ;
82- async move { }
8383 }
8484 } ) ;
8585
@@ -122,8 +122,11 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
122122 } else {
123123 "none" . to_string ( )
124124 } ;
125- let background = button_theme. background ;
126- let color = button_theme. font_theme . color ;
125+ let ButtonTheme {
126+ background,
127+ font_theme : FontTheme { color, .. } ,
128+ ..
129+ } = theme. button ;
127130
128131 render ! (
129132 CursorArea {
0 commit comments