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

Fixed textarea overflow #1986

Merged
merged 4 commits into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed
- Fix [#1974](https://github.com/Microsoft/BotFramework-WebChat/issues/1974). Update `/docs/` folder to `/media/` and delete unused images, by [@corinagum](https://github.com/corinagum) in PR [#1975](https://github.com/Microsoft/BotFramework-WebChat/pull/1975)
- Fix [#1980](https://github.com/Microsoft/BotFramework-WebChat/issues/1980). Changed sendBoxTextArea styles to break words longer than the textarea, by [@tdurnford](https://github.com/tdurnford) in PR [#1986](https://github.com/Microsoft/BotFramework-WebChat/pull/1986)
- Fix [#1969](https://github.com/Microsoft/BotFramework-WebChat/issues/1969). Move `styleSet`s related to Adaptive Cards to full bundle, by [@corinagum](https://github.com/corinagum) in PR [#1987](https://github.com/Microsoft/BotFramework-WebChat/pull/1987)
- Fix [#1429](https://github.com/Microsoft/BotFramework-WebChat/issues/1429). Changed Markdown-it options to render newline characters correctly, by [@tdurnford](https://github.com/tdurnford) in PR [#1988](https://github.com/Microsoft/BotFramework-WebChat/pull/1988)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions __tests__/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,15 @@ test('textarea send on enter', async () => {

expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions);
});

test('textarea long text', async () => {
const { driver } = await setupWebDriver({ props: { styleOptions }});

compulim marked this conversation as resolved.
Show resolved Hide resolved
const textarea = await driver.findElement(By.tagName('textarea'));

await textarea.sendKeys('https://github.com/microsoft/BotFramework-WebChat/blob/master/packages/component/src/Styles/defaultStyleSetOptions.js');

const base64PNG = await driver.takeScreenshot();

expect(base64PNG).toMatchImageSnapshot(imageSnapshotOptions);
});
6 changes: 4 additions & 2 deletions packages/component/src/Styles/StyleSet/SendBoxTextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ export default function createSendBoxTextAreaStyle({
fontFamily: 'inherit',
fontSize: 'inherit',
height: '100%',
overflowY: 'scroll',
overflowY: 'auto',
whiteSpace: 'pre-wrap',
width: 'inherit',
wordBreak: 'break-word'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we following styleOptions.messageActivityWordBreak? @corinagum what do you think?

If yes, should we add more tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm good point. However, if it's not 'break-word' it creates undesired behavior so I think we would want it to stay on 'break-word' always.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My brain stuck last week. Please keep break-word.

},

'& > textarea': {
Expand All @@ -43,7 +44,8 @@ export default function createSendBoxTextAreaStyle({
position: 'absolute',
resize: 'none',
top: 0,
width: '100%'
width: '100%',
wordBreak: 'break-word'
}
}
}
Expand Down