NbLayoutDirectionService: Cannot read properties of null (reading 'setAttribute')
- Ngôn ngữ chính
- TypeScript
- Star
- 8.1k
- Fork
- 1.5k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
NbLayoutDirectionService throws error on second direction change.
The error doesn't appear when changing the direction for the first time
```
ERROR TypeError: Cannot read properties of null (reading 'setAttribute')
at OverlayRef._updateElementDirection (overlay-module-6629f4c6.mjs:1171:16)
at OverlayRef.setDirection (overlay-module-6629f4c6.mjs:1133:10)
at Object.next (nebular-theme.mjs:4169:74)
at ConsumerObserver2.next (Subscriber.js:90:25)
at Subscriber2._next (Subscriber.js:59:22)
at Subscriber2.next (Subscriber.js:32:12)
at Subject.js:41:22
at errorContext (errorContext.js:23:5)
at Subject2.next (Subject.js:31:5)
at Object.next (share.js:57:25)
```
@nebular/theme: 15.0.0
```typescript
setAppLanguage() {
const language =
this.currentUserProfile?.preferred_langcode ||
navigator.language.split('-')[0] ||
'en';
this.translateService.use(language);
const direction =
language === 'en' ? NbLayoutDirection.LTR : NbLayoutDirection.RTL;
this.layoutDirectionService.setDirection(direction);
}
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.