chat: fix input length styling after commands
This commit is contained in:
parent
458c884462
commit
ac699e3320
|
@ -82,8 +82,8 @@
|
||||||
:ios {:line-height min-input-height
|
:ios {:line-height min-input-height
|
||||||
:left (+ 10 left)}})
|
:left (+ 10 left)}})
|
||||||
|
|
||||||
(defnstyle seq-input-text [left]
|
(defnstyle seq-input-text [left container-width]
|
||||||
{:min-width 200
|
{:min-width (- container-width left)
|
||||||
:font-size 14
|
:font-size 14
|
||||||
:position :absolute
|
:position :absolute
|
||||||
:text-align-vertical :center
|
:text-align-vertical :center
|
||||||
|
|
|
@ -160,11 +160,11 @@
|
||||||
arg-pos (subscribe [:current-chat-argument-position])
|
arg-pos (subscribe [:current-chat-argument-position])
|
||||||
seq-arg-input-text (subscribe [:chat :seq-argument-input-text])
|
seq-arg-input-text (subscribe [:chat :seq-argument-input-text])
|
||||||
sending-in-progress? (subscribe [:chat-ui-props :sending-in-progress?])]
|
sending-in-progress? (subscribe [:chat-ui-props :sending-in-progress?])]
|
||||||
(fn [{:keys [command-width]}]
|
(fn [{:keys [command-width container-width]}]
|
||||||
(when (get-in @command [:command :sequential-params])
|
(when (get-in @command [:command :sequential-params])
|
||||||
(let [{:keys [placeholder hidden type]} (get-in @command [:command :params @arg-pos])]
|
(let [{:keys [placeholder hidden type]} (get-in @command [:command :params @arg-pos])]
|
||||||
[text-input (merge {:ref #(dispatch [:set-chat-ui-props {:seq-input-ref %}])
|
[text-input (merge {:ref #(dispatch [:set-chat-ui-props {:seq-input-ref %}])
|
||||||
:style (style/seq-input-text command-width)
|
:style (style/seq-input-text command-width container-width)
|
||||||
:default-value (or @seq-arg-input-text "")
|
:default-value (or @seq-arg-input-text "")
|
||||||
:on-change-text #(do (dispatch [:set-chat-seq-arg-input-text %])
|
:on-change-text #(do (dispatch [:set-chat-seq-arg-input-text %])
|
||||||
(dispatch [:load-chat-parameter-box (:command @command)])
|
(dispatch [:load-chat-parameter-box (:command @command)])
|
||||||
|
@ -201,7 +201,8 @@
|
||||||
:single-line-input? single-line-input?}]
|
:single-line-input? single-line-input?}]
|
||||||
[input-helper {:command command
|
[input-helper {:command command
|
||||||
:width width}]
|
:width width}]
|
||||||
[seq-input {:command-width width}]
|
[seq-input {:command-width width
|
||||||
|
:container-width container-width}]
|
||||||
(if-not command
|
(if-not command
|
||||||
[touchable-highlight
|
[touchable-highlight
|
||||||
{:on-press #(do (dispatch [:toggle-chat-ui-props :show-emoji?])
|
{:on-press #(do (dispatch [:toggle-chat-ui-props :show-emoji?])
|
||||||
|
|
Loading…
Reference in New Issue