-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fluent: increase send box text size to prevent unwanted zoom on mobile (
#5192) * Fluent: increase focused send box text size to prevent unwanted zoom on mobile * Self review * Changelog
- Loading branch information
Showing
6 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+62.2 KB
...-coarse-pointer-js-fluent-theme-applied-should-handle-coarse-pointer-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.1 KB
...-coarse-pointer-js-fluent-theme-applied-should-handle-coarse-pointer-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script> | ||
<script crossorigin="anonymous" src="/test-harness.js"></script> | ||
<script crossorigin="anonymous" src="/test-page-object.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script> | ||
</head> | ||
<body> | ||
<main id="webchat"></main> | ||
<script type="text/babel"> | ||
run(async function () { | ||
const { | ||
React, | ||
ReactDOM: { render }, | ||
WebChat: { FluentThemeProvider, ReactWebChat } | ||
} = window; // Imports in UMD fashion. | ||
|
||
// GIVEN: On mobile device | ||
await host.sendDevToolsCommand('Emulation.setTouchEmulationEnabled', { | ||
enabled: true, | ||
configuration: 'mobile' | ||
}); | ||
|
||
const directLine = testHelpers.createDirectLineWithTranscript( | ||
testHelpers.transcriptNavigation.generateTranscript() | ||
); | ||
const store = testHelpers.createStore(); | ||
|
||
const App = () => <ReactWebChat directLine={directLine} store={store} />; | ||
|
||
render( | ||
<FluentThemeProvider> | ||
<App /> | ||
</FluentThemeProvider>, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
document.querySelector(`[data-testid="${WebChat.testIds.sendBoxTextBox}"]`).focus(); | ||
|
||
// WHEN: Typing text on mobile | ||
await host.sendKeys('A quick brown fox jumped over the lazy dog.'); | ||
|
||
// THEN: Increases font-size to prevent zoom-in action | ||
await host.snapshot(); | ||
|
||
// WHEN: Removing focus from the text box | ||
document.querySelector(`[data-testid="${WebChat.testIds.sendBoxTextBox}"]`).blur(); | ||
|
||
// THEN: Decreases font-size back | ||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('Fluent theme applied', () => { | ||
test('should handle coarse pointer', () => runHTML('fluentTheme/simple.coarsePointer')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters