Minor Changes
-
#1926
82b9931Thanks @bataevvlad! -Avatargainsnameandstatus. Without asource, or when the image fails to load,namerenders
as initials (the first letter of the first two words) in a frame of the same size and shape, coloured by
status, and is the avatar's accessible name. The Eva and MaterialAvatarmappings gaintextFontSize
per size,textFontFamily/textFontWeight, and astatusvariant group withbackgroundColor/
textColor(#1806). -
#1922
e4413ecThanks @bataevvlad! -ButtonGroupno longer overwritesappearance,statusandsizeset on a childButton; the child's
values win over the group's. It also gainsselectedIndexandonSelect: the selected button renders
filledwhile the others keep the group appearance, andonSelectreceives the index of the pressed
button after that button's ownonPress, which makes a segmented toggle a two-prop change (#1369). -
#1925
71e6a27Thanks @bataevvlad! -DatepickerandRangeDatepickergainpopoverProps, props for thePopoverthat shows the calendar:
fullWidthmakes the calendar take the width of the control (the calendar already shrinks to its container
since 6.1.3),styleis merged after the built-in popover style, andblocking,anchorContainerStyleor
onBackdropPress(called before the picker closes) pass through.placementandbackdropStyleset directly
on the picker win (#1707). -
#1927
30cdeb7Thanks @bataevvlad! -InputgainstextInputRef, a ref to the underlying React NativeTextInput, for libraries that expect a
native input (setNativeProps,measure, ...). The component ref keeps theInputRefAPI (focus,blur,
isFocused,clear).Autocompleteforwards it to itsInput(#1520). -
#1929
c1bbc79Thanks @bataevvlad! - NewPageIndicator: dots for aViewPager, one per page, the selected one wider and coloured bystatus.
Feed itselectedIndex, optionallyprogress(offset / pageWidthfromonOffsetChange) so the dots
follow the swipe, andonSelectto jump to a pressed dot. Dot size, spacing and colours come from the new
PageIndicatorblock of the Eva and Material mappings.ViewPagernow forwards a consumeronLayout(the
layout of its content strip, pages x page width) instead of dropping it (#1355). -
#1916
0fb3c97Thanks @bataevvlad! -SelectacceptslistRefandlistProps(#1912): a ref to theListthat renders the options and props forwarded to it such asgetItemLayoutorinitialScrollIndex, so a long options list can be scrolled to the selected option when it opens. -
#1923
c9a4c75Thanks @bataevvlad! -Selectgainsplacement(defaultbottom, the same values asAutocompleteandDatepicker) and
popoverProps, props for thePopoverthat shows the options:fullWidth(stilltrueby default;false
sizes the list by its content orstyle),blocking,anchorContainerStyle,backdropStyle,styleand
onBackdropPress, which runs before the list closes (#1331). -
#1928
653516dThanks @bataevvlad! - Typed theme tokens.@ui-kitten/evaexportsEvaThemeKey(the union of every token in the light and dark
themes) andEvaTheme, and typeslight/darkwith it;@ui-kitten/materialdoes the same with
MaterialThemeKey/MaterialTheme.@ui-kitten/componentsexportsKnownThemeKey(the union of both)
andThemeKey(KnownThemeKey | string);ThemeType,useTheme()and theuseThemeValueselectors
suggest the known tokens while custom tokens still type-check through thestringindex signature.
The types are generated from the theme JSON files (yarn theme-types:generate, checked in CI) (#1682).
Patch Changes
-
#1930
a8db98aThanks @bataevvlad! - On Android, text with the defaultSystemfont family now keeps its exactfontWeight. React Native Android treats anyfontFamilyas a custom family and rounds the weight to regular or bold, so500/600text (subtitles, labels, radio and checkbox text, avatar initials) rendered regular. Styles resolved from the theme now leave the family unset when it isSystemon Android; iOS and custom families are unchanged. -
#1931
00168faThanks @bataevvlad! -Autocompletederives its input field's test ids fromtestID(@@<testID>/input/input, container@@<testID>/input/container) instead of the fixed@@autocomplete/input/input, so several autocompletes on one screen can be told apart in tests. Without atestIDthe field keeps the old id. -
#1917
ce75d36Thanks @bataevvlad! -Button,CheckBox,RadioandTogglerender nothing for an empty string label instead of an empty text node inside theirView(#1913), which react-native-web reported as "Unexpected text node". -
#1933
ff7c701Thanks @bataevvlad! - A numeric0label or title now renders as "0" instead of nothing.FalsyText(used for the labels, captions and titles ofButton,CheckBox,Radio,Toggle,Input,ListItemand others) rendered nothing for any falsy value; it now skips onlynull,undefined,falseand an empty string.Apps that hide a text prop with a number and
&&now show a stray "0":description={count && `${count} items`}renders "0" whencountis 0, as React itself does for{0 && ...}. Usecount > 0 && ...instead. -
#1921
e42b131Thanks @bataevvlad! -Input,Select,DatepickerandRangeDatepickerspace their caption from the field by the mappingcaptionMarginTop(4 in Eva and Material); the token was defined but never applied, so captions sat flush under the field. The Eva mapping gains the token forInput,SelectandDatepicker(Material already had it). TheDatepickerpopover no longer takescaptionMarginTopas its bottom margin. Screens with captions move them 4 dp down. -
#1915
4c78a53Thanks @bataevvlad! -ModalandPopover(so alsoSelect,Datepicker,RangeDatepicker,OverflowMenu,Tooltip) allow every orientation by default (#1911). React Native'sModalsupports portrait only whensupportedOrientationsis omitted, so a popover opened while the device was in landscape came up rotated. iOS still restricts the modal to the orientations in the app'sInfo.plist. -
#1914
6e656a9Thanks @bataevvlad! -Popover(andSelect,Datepicker,Tooltip,OverflowMenu) no longer draws its content at the window origin for a frame on the first open (#1910). The anchor keeps the same place in the element tree from the start, so opening the popover no longer remounts it (anAutocompletefield no longer loses focus on the first tap); a closed popover still measures nothing. The content stays off screen until the anchor frame is known and follows the anchor when its frame changes while open. -
#1920
a524b74Thanks @bataevvlad! -Tooltip(and anyPopoverwith anindicator) keeps its arrow pointing at the anchor when the content was moved to stay on screen, for example a wide tooltip on a button near a screen edge: the arrow follows the anchor centre instead of staying in the middle of the tooltip, and stays inside the tooltip's edges. -
#1919
c9dd4e3Thanks @bataevvlad! -Popover(andAutocomplete,Select,Datepicker,Tooltip,OverflowMenu) keeps its content out from under the software keyboard: the keyboard height is subtracted from the placement bounds, so a list that would open under the keyboard flips to the other side of the anchor, and the placement is redone when the keyboard appears or hides while the popover is open. A non-blocking popover (Autocomplete) now follows its anchor while the screen behind it scrolls, and hides the content while the anchor is out of view. -
#1924
6ac1299Thanks @bataevvlad! -Selectscrolls its options to the selected one when the list opens (the first selected option of a
multi-select, the group row of a grouped option), so a selection past the visible rows is in view on
reopen. AlistProps.initialScrollIndextakes over when set (#822). -
#1934
73e990fThanks @bataevvlad! - On web, clicking anAutocompleteoption with the mouse selects it: the mouse-down no longer moves the focus away from the input, whose blur closed the list before the click arrived.ModalsetspointerEventsthrough its style, which removes react-native-web's "props.pointerEvents is deprecated" warning.