Enforce a minimum size requirement on the responseRegion attribute.
The touch target for primary interactive elements or components should be at least 48 vp * 48 vp (recommended), and should not be less than 40 vp * 40 vp.
// code-linter.json5
{
"rules": {
"@cross-device-app-dev/touch-target-size": "warn"
}
} @Entry
@Component
struct Index {
build() {
RelativeContainer() {
Text('message').responseRegion({width: 60, height: 60})
}
}
} @Entry
@Component
struct Index {
build() {
RelativeContainer() {
Text('message').responseRegion({width: 27, height: 40})
}
}
} plugin:@cross-device-app-dev/recommended plugin:@cross-device-app-dev/all
For details about how to configure Code Linter check rules, see Code Linter.