Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(message-input): NO-JIRA preventTyping not working with pills #375

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

bianca-artola-dialpad
Copy link
Contributor

fix(message-input): NO-JIRA preventTyping not working with pills

Obligatory GIF (super important!)

Obligatory GIF

🛠️ Type Of Change

These types will increment the version number on release:

  • Fix

📖 Description

We need to disallow typing when a pill is selected.

💡 Context

The fix I introduced to prevent users typing #371 when a pill is present did not work.
The problem seems to be that the old value (this.value) is something like this <meeting-pill text="Start a meeting" close-button-aria-label="Delete meeting pill"/> while value is something like /dpm{newCharacter}, so when we did value.length > this.value.length the first time, it returned false and the value was updated.
So the fix I made this time was to disallow typing if keyCode is different from 8 (backspace key), so we don't need to register the length of the old and new values. If you come up with something better, please let me know, but so far this is the best I have found.

@bianca-artola-dialpad bianca-artola-dialpad added the no-visual-test Add this tag when the PR does not need visual testing label Jun 18, 2024
Copy link

✔️ Deploy previews ready!
😎 Dialtone preview: https://dialtone.dialpad.com/deploy-previews/pr-375/
😎 Dialtone-vue 2 preview: https://dialtone.dialpad.com/vue/deploy-previews/pr-375/
😎 Dialtone-vue 3 the preview: https://dialtone.dialpad.com/vue3/deploy-previews/pr-375/

@bianca-artola-dialpad bianca-artola-dialpad merged commit 1091d61 into staging Jun 18, 2024
10 checks passed
@bianca-artola-dialpad bianca-artola-dialpad deleted the NO-JIRA_msg_input_prevent_typing_fix branch June 18, 2024 15:10
juliodialpad pushed a commit that referenced this pull request Jun 18, 2024
# [9.49.0](dialtone/v9.48.0...dialtone/v9.49.0) (2024-06-18)

### Bug Fixes

* **Message Input:** NO-JIRA preventTyping not working with pills ([#375](#375)) ([1091d61](1091d61))
* **Rich Text Editor:** DLT-1822 inputs with line breaks are not working for editor ([#374](#374)) ([d0d16de](d0d16de))

### Features

* **Icon:** DLT-1804 add webex ([#367](#367)) ([72cab26](72cab26))
juliodialpad pushed a commit that referenced this pull request Jun 18, 2024
## [2.139.2](dialtone-vue2/v2.139.1...dialtone-vue2/v2.139.2) (2024-06-18)

### Bug Fixes

* **Message Input:** NO-JIRA preventTyping not working with pills ([#375](#375)) ([1091d61](1091d61))
* **Rich Text Editor:** DLT-1822 inputs with line breaks are not working for editor ([#374](#374)) ([d0d16de](d0d16de))
juliodialpad pushed a commit that referenced this pull request Jun 18, 2024
## [3.132.2](dialtone-vue3/v3.132.1...dialtone-vue3/v3.132.2) (2024-06-18)

### Bug Fixes

* **Message Input:** NO-JIRA preventTyping not working with pills ([#375](#375)) ([1091d61](1091d61))
* **Rich Text Editor:** DLT-1822 inputs with line breaks are not working for editor ([#374](#374)) ([d0d16de](d0d16de))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-visual-test Add this tag when the PR does not need visual testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants