-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(text-field): Missing style attributes and examples (#1002)
Add missing attributes that apply to `text-field` element: - `selectionColor` (https://reactnative.dev/docs/textinput#selectioncolor) - `cursorColor` (Android only, [ref](https://reactnative.dev/docs/textinput#cursorcolor-android)) - `textAlignVertical` (style attribute, Android only, [ref](https://reactnative.dev/docs/text-style-props#textalignvertical-android)) Also add missing examples for text-input in the demo app, and update the docs. | iOS | Android | |----|----| | <img width="500" alt="Screenshot 2024-11-22 at 3 22 31 PM" src="https://github.com/user-attachments/assets/57255e96-7004-4ebc-ae44-ad9b40ba7b3b"> | <img width="527" alt="Screenshot 2024-11-22 at 3 22 34 PM" src="https://github.com/user-attachments/assets/c9d7a88b-4c23-4d45-8560-5227ae19eb40"> | --------- Co-authored-by: flochtililoch <flochtililoch@gmail.com>
- Loading branch information
1 parent
b887b4f
commit e3bca58
Showing
8 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
demo/backend/ui/ui-elements/forms/text-field/_basic/index.xml.njk
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,12 @@ | ||
<view style="form-group"> | ||
<text style="label">Basic</text> | ||
<text-field | ||
style="text-field-basic" | ||
name="text-field-basic" | ||
placeholder="Placeholder" | ||
placeholderTextColor="#8D9494" | ||
selectionColor="#4778FF" | ||
cursorColor="#4778FF" | ||
value="" | ||
/> | ||
</view> |
16 changes: 16 additions & 0 deletions
16
demo/backend/ui/ui-elements/forms/text-field/_basic/styles.xml.njk
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,16 @@ | ||
<style | ||
id="text-field-basic" | ||
borderBottomColor="#E1E1E1" | ||
borderBottomWidth="1" | ||
flex="1" | ||
fontSize="16" | ||
fontWeight="normal" | ||
paddingVertical="8" | ||
> | ||
<modifier pressed="true"> | ||
<style borderBottomColor="#4778FF"/> | ||
</modifier> | ||
<modifier focused="true"> | ||
<style borderBottomColor="#4778FF"/> | ||
</modifier> | ||
</style> |
13 changes: 13 additions & 0 deletions
13
demo/backend/ui/ui-elements/forms/text-field/_multiline/index.xml.njk
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,13 @@ | ||
<view style="form-group"> | ||
<text style="label">Multi-line</text> | ||
<text-field | ||
style="text-field-multiline" | ||
multiline="true" | ||
name="text-field-multiline" | ||
placeholder="Placeholder" | ||
placeholderTextColor="#8D9494" | ||
selectionColor="#4778FF" | ||
cursorColor="#4778FF" | ||
value="" | ||
/> | ||
</view> |
19 changes: 19 additions & 0 deletions
19
demo/backend/ui/ui-elements/forms/text-field/_multiline/styles.xml.njk
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,19 @@ | ||
<style | ||
id="text-field-multiline" | ||
borderRadius="6" | ||
borderWidth="1" | ||
borderColor="#E1E1E1" | ||
flex="1" | ||
fontSize="16" | ||
fontWeight="normal" | ||
height="120" | ||
padding="8" | ||
textAlignVertical="top" | ||
> | ||
<modifier pressed="true"> | ||
<style borderColor="#4778FF"/> | ||
</modifier> | ||
<modifier focused="true"> | ||
<style borderColor="#4778FF"/> | ||
</modifier> | ||
</style> |
32 changes: 32 additions & 0 deletions
32
demo/backend/ui/ui-elements/forms/text-field/index.xml.njk
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,32 @@ | ||
--- | ||
permalink: "/ui/ui-elements/forms/text-field/index.xml" | ||
tags: "UI/UI Elements/Forms" | ||
hv_title: "Text Field" | ||
hv_button_behavior: "back" | ||
--- | ||
{% extends 'templates/scrollview.xml.njk' %} | ||
{% from 'macros/about/index.xml.njk' import about %} | ||
{% from 'macros/description/index.xml.njk' import description %} | ||
{% from 'macros/button/index.xml.njk' import button %} | ||
|
||
{% block styles %} | ||
<style id="form-group" flex="1" marginLeft="24" marginRight="24" marginTop="48"/> | ||
<style | ||
id="label" | ||
borderColor="#4E4D4D" | ||
fontSize="16" | ||
fontWeight="bold" | ||
lineHeight="24" | ||
marginBottom="8" | ||
/> | ||
{% include './_basic/styles.xml.njk' %} | ||
{% include './_multiline/styles.xml.njk' %} | ||
{% endblock %} | ||
{% block content %} | ||
{{ about('Text field are used in forms to collect textual data') }} | ||
<form> | ||
{% include './_basic/index.xml.njk' %} | ||
{% include './_multiline/index.xml.njk' %} | ||
</form> | ||
{% endblock %} |
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