-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui5-input): fix typeahead on mobile devices (#5292)
* fix(ui5-input): fix typeahead on mobile devices The component no longer throws an exception when the input has suggestions and the typeahead functionality is adjusted. * fix(ui5-input): fix typeahead on mobile devices add tests * fix(ui5-input): fix typeahead on mobile devices try different DOM selectors in the mobile tests * fix(ui5-input): fix typeahead on mobile devices adjust mobile tests * fix(ui5-input): fix typeahead on mobile devices adjust tests * fix(ui5-input): fix typeahead on mobile devices adjust mobile tests
- Loading branch information
Showing
4 changed files
with
67 additions
and
20 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
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
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,37 @@ | ||
const assert = require("chai").assert; | ||
const PORT = require("./_port.js"); | ||
|
||
describe("Typeahead", () => { | ||
before(async () => { | ||
await browser.url(`http://localhost:${PORT}/test-resources/pages/Input.html`); | ||
await browser.emulateDevice('iPhone X'); | ||
}); | ||
|
||
it("Should autocomplete the first matched suggestion item", async () => { | ||
const input = await browser.$("#myInput2"); | ||
const sExpected = "Cozy"; | ||
const staticAreaItemClassName = await browser.getStaticAreaItemClassName("#myInput2") | ||
|
||
await input.scrollIntoView(); | ||
await input.click(); | ||
|
||
const dialogInput = await browser.$(`.${staticAreaItemClassName}`).shadow$("ui5-responsive-popover").$(".ui5-input-inner-phone"); | ||
await dialogInput.keys("c"); | ||
assert.strictEqual(await dialogInput.getProperty("value"), sExpected, "Value is autocompleted"); | ||
}); | ||
|
||
it("Should not perform typeahead when it is disabled", async () => { | ||
await browser.url(`http://localhost:${PORT}/test-resources/pages/Input.html`); | ||
|
||
const input = await browser.$("#input-disabled-autocomplete"); | ||
const staticAreaItemClassName = await browser.getStaticAreaItemClassName("#input-disabled-autocomplete") | ||
|
||
await input.scrollIntoView(); | ||
await input.click(); | ||
|
||
const dialogInput = await browser.$(`.${staticAreaItemClassName}`).shadow$("ui5-responsive-popover").$(".ui5-input-inner-phone"); | ||
await dialogInput.keys("c"); | ||
|
||
assert.strictEqual(await dialogInput.getProperty("value"), "c", "Value is not autocompleted"); | ||
}); | ||
}); |
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