Skip to content

Commit db34abb

Browse files
committed
docs(highlight): reduce "through" overuse and fix grammar/style
1 parent 18c9a35 commit db34abb

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

docs/xplat/src/content/en/components/inputs/highlight.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
1818

1919
## Usage
2020

21-
To use the <ApiLink type="Highlight" /> component, all you need to do is wrap its tags around the content you want to search through. The component searches through the content of all nested elements within the <PlatformBlock for="WebComponents">`<igc-highlight>`</PlatformBlock><PlatformBlock for="React">`<IgrHighlight>`</PlatformBlock> tags, and highlights all matches of the specified string.
21+
To use the <ApiLink type="Highlight" /> component, all you need to do is wrap its tags around the content you want to search. The component searches the content of all nested elements within the <PlatformBlock for="WebComponents">`<igc-highlight>`</PlatformBlock><PlatformBlock for="React">`<IgrHighlight>`</PlatformBlock> tags, and highlights all matches of the specified string.
2222

2323
<DocsAside type="note">
24-
The <ApiLink type="Highlight" /> component searches only through DOM text nodes. It does not search through input values or content set via the CSS `content` property.
24+
The <ApiLink type="Highlight" /> component searches only DOM text nodes. It does not search input values or content set via the CSS `content` property.
2525
</DocsAside>
2626

2727
First, you need to install the {ProductName} by running the following command:
@@ -78,13 +78,13 @@ The `<igc-highlight>` tags wrap the content in which you want to highlight the s
7878
The `<IgrHighlight>` tags wrap the content in which you want to highlight the specific string.
7979
</PlatformBlock>
8080

81-
The text to be highlighted is set through the <ApiLink type="Highlight" member="searchText" label="search-text"/> attribute. In the example above, the word "dolor" will be highlighted.
81+
The text to be highlighted is set via the <ApiLink type="Highlight" member="searchText" label="search-text"/> attribute. In the example above, the word "dolor" will be highlighted.
8282

8383
<Sample src="/inputs/highlight/overview" height={100} alt="{Platform} Highlight Overview Example" />
8484

8585
### Case Sensitive Match
8686

87-
The <ApiLink type="Highlight" /> component also exposes a <ApiLink type="Highlight" member="caseSensitive" label="case-sensitive"/> attribute. Its default value is `false`, which returns case-insensitive matches. By setting it to `true` you can enable case-sensitive matching.
87+
The <ApiLink type="Highlight" /> component also exposes a <ApiLink type="Highlight" member="caseSensitive" label="case-sensitive"/> attribute. Its default value is `false`, which enables case-insensitive matching. By setting it to `true`, you can enable case-sensitive matching.
8888

8989
The following snippet:
9090

@@ -104,22 +104,22 @@ The following snippet:
104104
```
105105
</PlatformBlock>
106106

107-
Returns 0 matches because the search text "lorem" is in lowercase, while the text in the content is **Lorem** with an uppercase **L**.
107+
This returns 0 matches because the search text "lorem" is in lowercase, while the text in the content is **Lorem** with an uppercase **L**.
108108

109109
### Using Highlight with a Search Input
110110

111111
The most common use case is binding the <ApiLink type="Highlight" /> component to a search <ApiLink type="Input" /> component, so that search matches are highlighted in real time as the user types.
112112

113-
To bind the two together you can listen to the `igcInput` event of the <ApiLink type="Input" /> component and set the <ApiLink type="Highlight" member="searchText" label="search-text"/> attribute of the <ApiLink type="Highlight" /> component to the input value every time the event is fired (you can also use the standard `input` event).
113+
To bind the two together, you can listen to the `igcInput` event of the <ApiLink type="Input" /> component and set the <ApiLink type="Highlight" member="searchText" label="search-text"/> attribute of the <ApiLink type="Highlight" /> component to the input value every time the event is fired (you can also use the standard `input` event).
114114

115115
<PlatformBlock for="WebComponents">
116-
First you need to access the <ApiLink type="Highlight" /> component so you can manipulate its properties:
116+
First, you need to access the <ApiLink type="Highlight" /> component to manipulate its properties:
117117

118118
```ts
119119
const highlight = document.querySelector('igc-highlight') as IgcHighlightComponent;
120120
```
121121

122-
Then create a function that updates the search text every time the input value changes through the `igcInput` event:
122+
Then, create a function that updates the search text every time the `igcInput` event fires:
123123

124124
```ts
125125
const onInput = ({ detail }: CustomEvent<string>) => {
@@ -140,7 +140,7 @@ document.querySelector('igc-input')?.addEventListener('igcInput', onInput);
140140
</PlatformBlock>
141141

142142
<PlatformBlock for="React">
143-
First you need to access the <ApiLink type="Highlight" /> component so you can manipulate its properties, the easiest way to do that is through a reference:
143+
First, you need to access the <ApiLink type="Highlight" /> component to manipulate its properties. The easiest way to do this is via a reference:
144144

145145
```tsx
146146
import { useRef } from 'react';
@@ -156,7 +156,7 @@ const highlightRef = useRef<IgrHighlight>(null);
156156
</IgrHighlight>
157157
```
158158

159-
Then create a function that will update the status of the search, which will be called every time the value of the search input changes through the `igcInput` event:
159+
Then, create a function that updates the search text, called every time the `igcInput` event fires:
160160

161161
```tsx
162162
const onInput = ({ detail }: CustomEvent<string>) => {
@@ -171,9 +171,9 @@ const onInput = ({ detail }: CustomEvent<string>) => {
171171

172172
### Methods
173173

174-
The component also exposes two methods that allow you to navigate through the matches of the searched text. The <ApiLink type="Highlight" member="next" label="next()"/> method will navigate to the next match, while the <ApiLink type="Highlight" member="previous" label="previous()"/> method will navigate to the previous match.
174+
The component also exposes two methods for navigating the search matches. The <ApiLink type="Highlight" member="next" label="next()"/> method moves to the next match, while the <ApiLink type="Highlight" member="previous" label="previous()"/> method moves to the previous one.
175175

176-
With them we can make the search more interactive by creating two buttons that will allow you to navigate through the matches:
176+
With them, we can make the search more interactive by adding two buttons to navigate between matches:
177177

178178
<PlatformBlock for="WebComponents">
179179
```ts
@@ -241,7 +241,7 @@ const next = () => {
241241

242242
<Sample src="/inputs/highlight/search" height={200} alt="{Platform} Highlight Search Example" />
243243

244-
Both the <ApiLink type="Highlight" member="previous" label="previous()" /> and <ApiLink type="Highlight" member="next" label="next()" /> methods accept a <ApiLink type="Highlight" member="preventScroll" /> option that prevents the page from scrolling to the active match during navigation. By default, the option is set to `false`.
244+
Both the <ApiLink type="Highlight" member="previous" label="previous()" /> and <ApiLink type="Highlight" member="next" label="next()" /> methods accept a <ApiLink type="Highlight" member="preventScroll" /> option that prevents the page from scrolling to the active match during navigation. By default, it is set to `false`.
245245

246246
<PlatformBlock for="WebComponents">
247247
```ts
@@ -304,7 +304,7 @@ const updateStatus = () => {
304304
```
305305
</PlatformBlock>
306306

307-
Then we can call the `updateStatus()` function every time the value of the search input changes and every time the user clicks on the next or previous buttons:
307+
We can then call `updateStatus()` every time the input value changes or the user clicks the next or previous buttons:
308308

309309
<PlatformBlock for="WebComponents">
310310
```ts

0 commit comments

Comments
 (0)