diff --git a/CHANGELOG.md b/CHANGELOG.md index a0be3fa7d1..92cd71b897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ * Revert adjusting bootstrap scripts for developing on Windows +* Channel input - replaced ContentEditable with textarea + +* Fix - up/down arrows now work properly inside channel input (textarea) + [2.0.1-alpha.2] * UI layer for taken usernames for desktop and mobile diff --git a/packages/desktop/cypress/snapshots/base/src/renderer/components/Channel/Channel.regression.cy.tsx/message input words wrapping-base.png b/packages/desktop/cypress/snapshots/base/src/renderer/components/Channel/Channel.regression.cy.tsx/message input words wrapping-base.png index 199d3f83f1..3d1caa34a7 100644 Binary files a/packages/desktop/cypress/snapshots/base/src/renderer/components/Channel/Channel.regression.cy.tsx/message input words wrapping-base.png and b/packages/desktop/cypress/snapshots/base/src/renderer/components/Channel/Channel.regression.cy.tsx/message input words wrapping-base.png differ diff --git a/packages/desktop/package-lock.json b/packages/desktop/package-lock.json index 766696fb1a..ae6b1a5a16 100644 --- a/packages/desktop/package-lock.json +++ b/packages/desktop/package-lock.json @@ -109,7 +109,6 @@ "rc-scrollbars": "^1.1.5", "react": "18.1.0", "react-alice-carousel": "^1.15.3", - "react-contenteditable": "^3.3.3", "react-copy-to-clipboard": "^5.1.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", @@ -26973,12 +26972,6 @@ "chance": "^1.0.4" } }, - "node_modules/fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, "node_modules/fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -38548,19 +38541,6 @@ "react": "^0.14.0 || ^15.0.0-0 || ^16.0.0-0" } }, - "node_modules/react-contenteditable": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/react-contenteditable/-/react-contenteditable-3.3.3.tgz", - "integrity": "sha512-3sOt9x6A7SzHqJgFRqKfaUnIh2tdxrdnJcE/0g1dN/g3twsqNxMxUCJGWvZUUDIQjUzqdSz6tsnGdddrPr5UNg==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^2.0.1", - "prop-types": "^15.7.1" - }, - "peerDependencies": { - "react": ">=16.3" - } - }, "node_modules/react-copy-to-clipboard": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz", @@ -66622,12 +66602,6 @@ "chance": "^1.0.4" } }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -75550,16 +75524,6 @@ } } }, - "react-contenteditable": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/react-contenteditable/-/react-contenteditable-3.3.3.tgz", - "integrity": "sha512-3sOt9x6A7SzHqJgFRqKfaUnIh2tdxrdnJcE/0g1dN/g3twsqNxMxUCJGWvZUUDIQjUzqdSz6tsnGdddrPr5UNg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "prop-types": "^15.7.1" - } - }, "react-copy-to-clipboard": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 6a151ec6a4..ac4cc8707a 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -231,7 +231,6 @@ "rc-scrollbars": "^1.1.5", "react": "18.1.0", "react-alice-carousel": "^1.15.3", - "react-contenteditable": "^3.3.3", "react-copy-to-clipboard": "^5.1.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", diff --git a/packages/desktop/src/renderer/components/Channel/Channel.regression.cy.tsx b/packages/desktop/src/renderer/components/Channel/Channel.regression.cy.tsx index cb07239f0c..304db04a14 100644 --- a/packages/desktop/src/renderer/components/Channel/Channel.regression.cy.tsx +++ b/packages/desktop/src/renderer/components/Channel/Channel.regression.cy.tsx @@ -43,16 +43,13 @@ describe('Scroll behavior test', () => { it('scroll should be at the bottom after entering channel', () => { cy.get(channelContent).compareSnapshot('after launch', { - capture: 'fullPage' + capture: 'fullPage', }) }) it('scroll should be at the bottom after sending messages', () => { cy.get(messageInput).focus().type('luke where are you?').type('{enter}') - cy.get(messageInput) - .focus() - .type('you underestimate the power of the force') - .type('{enter}') + cy.get(messageInput).focus().type('you underestimate the power of the force').type('{enter}') cy.get(channelContent).compareSnapshot('send after enter') }) @@ -62,10 +59,7 @@ describe('Scroll behavior test', () => { cy.get(channelContent).compareSnapshot('scroll to the middle') cy.get(messageInput).focus().type('obi wan was wrong').type('{enter}') - cy.get(messageInput) - .focus() - .type('actually, he is on the dark side') - .type('{enter}') + cy.get(messageInput).focus().type('actually, he is on the dark side').type('{enter}') cy.get(channelContent).compareSnapshot('send after scroll') }) @@ -91,7 +85,7 @@ describe('Scroll behavior test', () => { it('PageUp keydown should scroll message list up.', () => { cy.get(messageInput).focus().type('{pageup}') cy.get(channelContent).compareSnapshot('after pageup', { - capture: 'fullPage' + capture: 'fullPage', }) }) @@ -99,7 +93,7 @@ describe('Scroll behavior test', () => { cy.get(channelContent).scrollTo(0, 0) cy.get(messageInput).focus().type('{pagedown}') cy.get(channelContent).compareSnapshot('after pagedown', { - capture: 'fullPage' + capture: 'fullPage', }) }) @@ -109,7 +103,7 @@ describe('Scroll behavior test', () => { .type('luke where are you?') .type('{shift+enter}') .type('you underestimate the power of the force') - .should('have.text', 'luke where are you?you underestimate the power of the force') + .should('have.text', 'luke where are you?\nyou underestimate the power of the force') }) it('Check words wrapping in message input', () => { @@ -120,9 +114,7 @@ describe('Scroll behavior test', () => { } return word } - cy.get(messageInput) - .focus() - .type(longWord()) + cy.get(messageInput).focus().type(longWord()) cy.get(messageInput).compareSnapshot('message input words wrapping') }) diff --git a/packages/desktop/src/renderer/components/SearchModal/SearchModal.tsx b/packages/desktop/src/renderer/components/SearchModal/SearchModal.tsx index 906752382c..590ce7354a 100644 --- a/packages/desktop/src/renderer/components/SearchModal/SearchModal.tsx +++ b/packages/desktop/src/renderer/components/SearchModal/SearchModal.tsx @@ -58,7 +58,7 @@ const SearchModal = () => { } }, [handleKeyDown]) - if (dynamicSearchedChannelsSelector.length === 0) return null + if (!searchChannelModal.open || dynamicSearchedChannelsSelector.length === 0) return null return ( {
{
-
-
- -
-
+