ionic-team / ionic-team/capacitor-barcode-scanner
Layout and scanning functionality breaks when rotating iOS device
- Dominant language
- TypeScript
- Stars
- 64
- Forks
- 47
- Avg merge
- 1h 55m
- Merged PRs (30d)
- 1
Description
Rotating the scanner from landscape to portrait, using the adaptive option, breaks the layout of the scan area and seems to cause the scanning functionality to stop. Although it does detect barcodes if you open the scanner in either portrait or landscape without rotating the device during scan.
This is how the scanner looks when entering in portrait (detecting barcodes works):

^ iPhone 14 Pro
And this is how the scanner looks when you have rotated from landscape to portrait within the scanner plugin (have not been able to detect barcodes in this state):

^ iPhone 14 Pro

^ iPhone 16 Pro Max (notice the right side)
These are the options that I pass in to the scanner:
```
const options: CapacitorBarcodeScannerOptions = {
hint: CapacitorBarcodeScannerTypeHint.CODE_128,
scanInstructions: 'Scan Barcode',
cameraDirection: CapacitorBarcodeScannerCameraDirection.BACK,
scanOrientation: CapacitorBarcodeScannerScanOrientation.ADAPTIVE,
android: {
scanningLibrary: CapacitorBarcodeScannerAndroidScanningLibrary.MLKIT
}
};
```
These are Capacitor + scanner versions (same result in plugin version 1.0.4 with Cap 6)
```
"@capacitor/barcode-scanner": "2.0.0",
"@capacitor/cli": "7.0.1",
"@capacitor/core": "7.0.1",
"@capacitor/ios": "7.0.1",
```
I'm not able to see any logs regarding this issue in Xcode. This was implemented in a fresh Angular project running Angular 17.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.