-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(input, textarea, select): add section for start and end slots #3271
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c3aa31c
add docs for input
d3ef7a5
add docs for textarea
9496178
add docs for select
a629f1a
account for width collapsing bug on select
d723ddd
lint
d921c48
spelling
c941f37
typo
175da46
add comment to temp patch
c7bac20
move auxillary info to note blocks
d704d5c
add note that clicking slots won't open select
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,12 @@ | ||
```html | ||
<ion-list> | ||
<ion-item> | ||
<ion-input labelPlacement="stacked" label="Email" placeholder="[email protected]"> | ||
<ion-icon slot="start" name="lock-closed" aria-hidden="true"></ion-icon> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-input> | ||
</ion-item> | ||
</ion-list> | ||
``` |
This file contains hidden or 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,31 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Input</title> | ||
<link rel="stylesheet" href="../../../common.css" /> | ||
<script src="../../../common.js"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@7/dist/ionic/ionic.esm.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@7/css/ionic.bundle.css" /> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-content> | ||
<div class="container"> | ||
<ion-list> | ||
<ion-item> | ||
<ion-input label-placement="stacked" label="Email" placeholder="[email protected]"> | ||
<ion-icon slot="start" name="lock-closed" aria-hidden="true"></ion-icon> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-input> | ||
</ion-item> | ||
</ion-list> | ||
</div> | ||
</ion-content> | ||
</ion-app> | ||
</body> | ||
</html> |
This file contains hidden or 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,17 @@ | ||
import Playground from '@site/src/components/global/Playground'; | ||
|
||
import javascript from './javascript.md'; | ||
import react from './react.md'; | ||
import vue from './vue.md'; | ||
import angular from './angular.md'; | ||
|
||
<Playground | ||
version="7" | ||
code={{ | ||
javascript, | ||
react, | ||
vue, | ||
angular, | ||
}} | ||
src="usage/v7/input/start-end-slots/demo.html" | ||
/> |
This file contains hidden or 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,12 @@ | ||
```html | ||
<ion-list> | ||
<ion-item> | ||
<ion-input label-placement="stacked" label="Email" placeholder="[email protected]"> | ||
<ion-icon slot="start" name="lock-closed" aria-hidden="true"></ion-icon> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-input> | ||
</ion-item> | ||
</ion-list> | ||
``` |
This file contains hidden or 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,21 @@ | ||
```tsx | ||
import React from 'react'; | ||
import { IonButton, IonIcon, IonInput, IonItem, IonList } from '@ionic/react'; | ||
import { eye, lockClosed } from 'ionicons/icons'; | ||
|
||
function Example() { | ||
return ( | ||
<IonList> | ||
<IonItem> | ||
<IonInput labelPlacement="stacked" label="Email" placeholder="[email protected]"> | ||
<IonIcon slot="start" icon={lockClosed} aria-hidden="true"></IonIcon> | ||
<IonButton fill="clear" slot="end" aria-label="Show/hide"> | ||
<IonIcon slot="icon-only" name={eye} aria-hidden="true"></IonIcon> | ||
</IonButton> | ||
</IonInput> | ||
</IonItem> | ||
</IonList> | ||
); | ||
} | ||
export default Example; | ||
``` |
This file contains hidden or 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,33 @@ | ||
```html | ||
<template> | ||
<ion-list> | ||
<ion-item> | ||
<ion-input label-placement="stacked" label="Email" placeholder="[email protected]"> | ||
<ion-icon slot="start" :icon="lockClosed" aria-hidden="true"></ion-icon> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide"> | ||
<ion-icon slot="icon-only" :icon="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-input> | ||
</ion-item> | ||
</ion-list> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { IonButton, IonIcon, IonInput, IonItem, IonList } from '@ionic/vue'; | ||
import { eye, lockClosed } from 'ionicons/icons'; | ||
import { defineComponent } from 'vue'; | ||
|
||
export default defineComponent({ | ||
components: { | ||
IonButton, | ||
IonIcon, | ||
IonInput, | ||
IonItem, | ||
IonList, | ||
}, | ||
setup() { | ||
return { eye, lockClosed }; | ||
}, | ||
}); | ||
</script> | ||
``` |
This file contains hidden or 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,15 @@ | ||
```html | ||
<ion-list> | ||
<ion-item> | ||
<ion-select labelPlacement="stacked" label="Favorite fruit" value="apple"> | ||
<ion-icon slot="start" name="leaf" aria-hidden="true"></ion-icon> | ||
<ion-select-option value="apple">Apple</ion-select-option> | ||
<ion-select-option value="banana">Banana</ion-select-option> | ||
<ion-select-option value="orange">Orange</ion-select-option> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide password"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-select> | ||
</ion-item> | ||
</ion-list> | ||
``` |
This file contains hidden or 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,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Select</title> | ||
<link rel="stylesheet" href="../../../common.css" /> | ||
<script src="../../../common.js"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@7/dist/ionic/ionic.esm.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@7/css/ionic.bundle.css" /> | ||
|
||
<style> | ||
/** | ||
* This is to deal with a bug in 7.6 where a select in a list/item | ||
* wrapped in a flex container will shrink to 0 width. When the bug | ||
* is fixed, we can remove this. | ||
*/ | ||
ion-list { | ||
min-width: 400px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-content> | ||
<div class="container"> | ||
<ion-list> | ||
<ion-item> | ||
<ion-select label-placement="stacked" label="Favorite fruit" value="apple"> | ||
<ion-icon slot="start" name="leaf" aria-hidden="true"></ion-icon> | ||
<ion-select-option value="apple">Apple</ion-select-option> | ||
<ion-select-option value="banana">Banana</ion-select-option> | ||
<ion-select-option value="orange">Orange</ion-select-option> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide password"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-select> | ||
</ion-item> | ||
</ion-list> | ||
</div> | ||
</ion-content> | ||
</ion-app> | ||
</body> | ||
</html> |
This file contains hidden or 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,18 @@ | ||
import Playground from '@site/src/components/global/Playground'; | ||
|
||
import javascript from './javascript.md'; | ||
import react from './react.md'; | ||
import vue from './vue.md'; | ||
import angular from './angular.md'; | ||
|
||
<Playground | ||
version="7" | ||
code={{ | ||
javascript, | ||
react, | ||
vue, | ||
angular, | ||
}} | ||
src="usage/v7/select/start-end-slots/demo.html" | ||
size="300px" | ||
/> |
This file contains hidden or 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,15 @@ | ||
```html | ||
<ion-list> | ||
<ion-item> | ||
<ion-select label-placement="stacked" label="Favorite fruit" value="apple"> | ||
<ion-icon slot="start" name="leaf" aria-hidden="true"></ion-icon> | ||
<ion-select-option value="apple">Apple</ion-select-option> | ||
<ion-select-option value="banana">Banana</ion-select-option> | ||
<ion-select-option value="orange">Orange</ion-select-option> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide password"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-select> | ||
</ion-item> | ||
</ion-list> | ||
``` |
This file contains hidden or 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,24 @@ | ||
```tsx | ||
import React from 'react'; | ||
import { IonButton, IonIcon, IonItem, IonList, IonSelect, IonSelectOption } from '@ionic/react'; | ||
import { eye, leaf } from 'ionicons/icons'; | ||
|
||
function Example() { | ||
return ( | ||
<IonList> | ||
<IonItem> | ||
<IonSelect labelPlacement="stacked" label="Favorite fruit" value="apple"> | ||
<IonIcon slot="start" icon={leaf} aria-hidden="true"></IonIcon> | ||
<IonSelectOption value="apple">Apple</IonSelectOption> | ||
<IonSelectOption value="banana">Banana</IonSelectOption> | ||
<IonSelectOption value="orange">Orange</IonSelectOption> | ||
<IonButton fill="clear" slot="end" aria-label="Show/hide password"> | ||
<IonIcon slot="icon-only" icon={eye} aria-hidden="true"></IonIcon> | ||
</IonButton> | ||
</IonSelect> | ||
</IonItem> | ||
</IonList> | ||
); | ||
} | ||
export default Example; | ||
``` |
This file contains hidden or 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 @@ | ||
```html | ||
<template> | ||
<ion-list> | ||
<ion-item> | ||
<ion-select label-placement="stacked" label="Favorite fruit" value="apple"> | ||
<ion-icon slot="start" :icon="leaf" aria-hidden="true"></ion-icon> | ||
<ion-select-option value="apple">Apple</ion-select-option> | ||
<ion-select-option value="banana">Banana</ion-select-option> | ||
<ion-select-option value="orange">Orange</ion-select-option> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide password"> | ||
<ion-icon slot="icon-only" :icon="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-select> | ||
</ion-item> | ||
</ion-list> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { IonButton, IonIcon, IonItem, IonList, IonSelect, IonSelectOption } from '@ionic/vue'; | ||
import { eye, leaf } from 'ionicons/icons'; | ||
import { defineComponent } from 'vue'; | ||
|
||
export default defineComponent({ | ||
components: { | ||
IonButton, | ||
IonIcon, | ||
IonItem, | ||
IonList, | ||
IonSelect, | ||
IonSelectOption, | ||
}, | ||
setup() { | ||
return { eye, leaf }; | ||
}, | ||
}); | ||
</script> | ||
``` |
This file contains hidden or 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,12 @@ | ||
```html | ||
<ion-list> | ||
<ion-item> | ||
<ion-textarea labelPlacement="stacked" label="Comments" placeholder="Enter your comments"> | ||
<ion-icon slot="start" name="lock-closed" aria-hidden="true"></ion-icon> | ||
<ion-button fill="clear" slot="end" aria-label="Show/hide"> | ||
<ion-icon slot="icon-only" name="eye" aria-hidden="true"></ion-icon> | ||
</ion-button> | ||
</ion-textarea> | ||
</ion-item> | ||
</ion-list> | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.