Skip to content

Commit

Permalink
Fix textinputs example
Browse files Browse the repository at this point in the history
This should fix the textinputs example, as the code is using KeyMsg. KeyMsg seems to have an issue with the v2
alpha where it appears that both KeyPressMsg and KeyReleaseMsg may be unintentionally being called sequentionally.
Just using one or the other should solve the issue for this. This issue also likely exists within other examples and may
Need to be looked at separately.

No PR/Issue Tag atm
  • Loading branch information
dogwaterdev1 committed Oct 4, 2024
1 parent 3274e41 commit ee61875
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/textinputs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (m model) Init() (tea.Model, tea.Cmd) {

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
case tea.KeyPressMsg:
switch msg.String() {
case "ctrl+c", "esc":
return m, tea.Quit
Expand Down

0 comments on commit ee61875

Please sign in to comment.